summaryrefslogtreecommitdiff
path: root/layouts/shortcodes
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2022-08-16 01:21:02 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2022-08-16 01:21:02 +0200
commitc0d248d18c4d2a8921ef59377c26382abbffe8c3 (patch)
treefa28596ff7a5f3dda63174ffa58b21ee81e99e79 /layouts/shortcodes
parentaccd771c040f2869e2e464d33cb90e70576ba7e1 (diff)
Update hugo framework
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r--layouts/shortcodes/hidvid.html10
-rw-r--r--layouts/shortcodes/img.html22
-rw-r--r--layouts/shortcodes/tagcloud.html3
-rw-r--r--layouts/shortcodes/vid.html6
4 files changed, 41 insertions, 0 deletions
diff --git a/layouts/shortcodes/hidvid.html b/layouts/shortcodes/hidvid.html
new file mode 100644
index 0000000..14f592d
--- /dev/null
+++ b/layouts/shortcodes/hidvid.html
@@ -0,0 +1,10 @@
+<details>
+ <summary>Click to reveal video.</summary>
+<iframe src="{{ index .Params 0 }}"
+ loading="lazy"
+ sandbox="allow-same-origin allow-scripts allow-popups"
+ allowfullscreen frameborder="0"
+ class="embvid"
+ title="Embedded Video">
+</iframe>
+</details>
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html
new file mode 100644
index 0000000..2df4ff6
--- /dev/null
+++ b/layouts/shortcodes/img.html
@@ -0,0 +1,22 @@
+<!--
+ class: class of the figure
+ link: url the image directs to
+ alt: alternative text
+ caption: caption
+ mouse: what the image says when moused over ("title" in HTML)
+-->
+<figure {{ with .Get "class" }}class="{{.}}"{{ end -}}>
+ {{- with .Get "link"}}<a href="{{.}}">{{ end -}}
+ <img src="{{ .Get "src" }}"
+ {{- with .Get "mouse" }} title="{{.}}"{{ end -}}
+ {{- with .Get "alt" }} alt="{{.}}"{{ end -}}
+ {{- with .Get "width" }} width="{{.}}"{{ end -}}
+ {{- with .Get "style" }} style="{{.}}"{{ end -}}
+ >
+ {{- if .Get "link"}}</a>{{ end -}}
+ {{- with .Get "caption" -}}
+ <figcaption>
+ {{- . -}}
+ </figcaption>
+ {{- end -}}
+</figure>
diff --git a/layouts/shortcodes/tagcloud.html b/layouts/shortcodes/tagcloud.html
new file mode 100644
index 0000000..0cf0118
--- /dev/null
+++ b/layouts/shortcodes/tagcloud.html
@@ -0,0 +1,3 @@
+{{ if isset .Site.Taxonomies "tags" }}{{ if not (eq (len .Site.Taxonomies.tags) 0) }} <ul id="tagcloud">
+ {{ range $name, $items := .Site.Taxonomies.tags }}{{ $url := printf "%s/%s" "tags" ($name | urlize | lower)}}<li><a href="{{ $url | absURL }}" id="tag_{{ $name }}">{{ $name | title }}</a></li>
+ {{ end }}</ul>{{ end }}{{ end }}
diff --git a/layouts/shortcodes/vid.html b/layouts/shortcodes/vid.html
new file mode 100644
index 0000000..4c612fe
--- /dev/null
+++ b/layouts/shortcodes/vid.html
@@ -0,0 +1,6 @@
+<iframe src="{{ index .Params 0 }}"
+ loading="lazy"
+ sandbox="allow-same-origin allow-scripts allow-popups"
+ allowfullscreen frameborder="0"
+ title="Embedded Video">
+</iframe>