summaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/rss.xml4
-rw-r--r--layouts/shortcodes/google-form.html37
2 files changed, 39 insertions, 2 deletions
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml
index df3173b..235fd30 100644
--- a/layouts/_default/rss.xml
+++ b/layouts/_default/rss.xml
@@ -1,4 +1,4 @@
-{{- /* Same as https://github.com/adityatelange/hugo-PaperMod/blob/master/layouts/_default/rss.xml but without Hugo branding */}}
+{{- /* Same as https://github.com/adityatelange/hugo-PaperMod/blob/master/layouts/_default/rss.xml but without Hugo branding and hiding 'page' layout from feed */}}
{{- $authorEmail := "" }}
{{- with site.Params.author }}
{{- if reflect.IsMap . }}
@@ -64,7 +64,7 @@
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
{{- end }}
{{- range $pages }}
- {{- if and (ne .Layout `search`) (ne .Layout `archives`) }}
+ {{- if and (ne .Layout `search`) (ne .Layout `archives`) (ne .Layout `page`) }}
<item>
<title>{{ .Title }}</title>
<link>{{ .Permalink }}</link>
diff --git a/layouts/shortcodes/google-form.html b/layouts/shortcodes/google-form.html
new file mode 100644
index 0000000..8036f56
--- /dev/null
+++ b/layouts/shortcodes/google-form.html
@@ -0,0 +1,37 @@
+<!-- Copied from https://github.com/Darthagnon/darths-hugo-shortcodes
+Forms: https://forms.google.com/
+
+Usage:
+
+google-form 1FAIpQLSdqRDjIhpvL1QTk_tnfzQ-KinpnykdcdpZsI9raxQgYBdxEnA
+
+Supply the sharecode obtained from the Google Forms >> Send button (not from the URL bar, it's different).
+Form fields, colour theme, etc. must be changed via Google's editor. (default width/height: 640 382, style="display: block; margin: auto;" aligns to centre)
+There's no easy way to auto-set iframe height (https://stackoverflow.com/questions/9975810/make-iframe-automatically-adjust-height-according-to-the-contents-without-using)
+so height must be specified if you don't want double scrollbars.
+
+border param will give your form a border (useful if it's scrollable)
+
+-->
+
+{{ if .IsNamedParams }}
+ <div class="embed google-forms">
+ <iframe src="https://docs.google.com/forms/d/e/{{ .Get "publishcode" }}/viewform?embedded=true"
+ width="100%"
+ {{ if .Get "size" | eq "small"}}height="150"
+ {{ else if .Get "size" | eq "medium"}}height="720"
+ {{ else if .Get "size" | eq "large"}}height="1080"
+ {{ else }}height="400"
+ {{ end }}
+ frameborder="0" marginheight="0" marginwidth="0" scrolling="yes" style="max-width: 100%; border: {{ if .Get "border" }}2px solid lightgray{{ else }}none{{end}}; display: block; margin: auto;"
+ >Loading Google Forms…</iframe>
+ <a href="{{ .Get "url" }}">
+ <img alt="Google Forms" style="top:-36px; position:relative; z-index:9; float: left;" height="32" src="https://www.gstatic.com/images/branding/product/1x/forms_2020q4_48dp.png">
+ </a>
+ </div>
+ {{ if .Site.Params.debug }}
+ <script>
+ console.log("Loaded user-editable external survey from Google Forms");
+ </script>
+ {{ end }}
+{{ end }}