diff --git a/assets/css/bobastyle.css b/assets/css/bobastyle.css
index 370b23c..a56b13b 100644
--- a/assets/css/bobastyle.css
+++ b/assets/css/bobastyle.css
@@ -198,14 +198,14 @@ video {
max-width: 100%;
}
-.post-media > figure.border img,
-.post-media > figure.border video {
+.post-media > figure img,
+.post-media > figure video {
padding: 5px;
border: 7px solid var(--figure-border);
}
-figure.border img,
-figure.border video {
+figure img,
+figure video {
padding: 5px;
border: 2px solid var(--figure-border);
}
diff --git a/i18n/en.yaml b/i18n/en.yaml
index 41890c4..a483e10 100644
--- a/i18n/en.yaml
+++ b/i18n/en.yaml
@@ -7,6 +7,8 @@ table_of_contents:
browser_no_video_support:
other: "Your browser does not support video."
+browser_no_video_support_link:
+ other: "Click here to download it instead."
latest_posts:
other: "Latest Posts"
diff --git a/layouts/_partials/embed-resource.html b/layouts/_partials/embed-resource.html
new file mode 100644
index 0000000..555bb39
--- /dev/null
+++ b/layouts/_partials/embed-resource.html
@@ -0,0 +1,23 @@
+{{ if eq .ResourceType "image" }}
+ {{/* TODO: figure out whether loading="lazy" should be set because MDN
+ * claims that images won't work with JS disabled since it would
+ * make tracking possible, but my experience says otherwise
+ */}}
+
+{{ else if eq .ResourceType "video" }}
+
+{{ else }}
+ {{/* TODO: could consider implementing more types, listed at:
+ * https://www.iana.org/assignments/media-types/media-types.xhtml
+ */}}
+ {{ errorf "Handling %q resource not supported" .ResourceType }}
+{{ end }}
diff --git a/layouts/_partials/feature-figure.html b/layouts/_partials/feature-figure.html
new file mode 100644
index 0000000..01df020
--- /dev/null
+++ b/layouts/_partials/feature-figure.html
@@ -0,0 +1,10 @@
+{{ with .Resources.Get "feature" }}
+
- {{ partial "figure.html" (dict "src" $resource "noborder" $noborder "hidecaption" $hidecaption) }} -
+ {{ with or (.Get "caption") (.Get 0) $resource_title }} +- {{ partial "remote_figure.html" (dict "src" (.Get "src") "border" $border "hidecaption" $hidecaption "type" (.Get "type") "alt" (.Get "alt")) }} -
diff --git a/layouts/_shortcodes/resource.html b/layouts/_shortcodes/resource.html new file mode 100644 index 0000000..c223dd7 --- /dev/null +++ b/layouts/_shortcodes/resource.html @@ -0,0 +1,9 @@ +{{ with .Get 0 }} + {{ with $.Page.Resources.Get . }} + {{ partial "embed-resource.html" . }} + {{ else }} + {{ errorf "resource %q not found" . }} + {{ end }} +{{ else }} + {{ errorf "resource name not provided as first parameter" }} +{{ end }} diff --git a/layouts/single.html b/layouts/single.html index 36dca8c..d6455c2 100644 --- a/layouts/single.html +++ b/layouts/single.html @@ -22,11 +22,7 @@ {{ end }} - {{ with .Resources.GetMatch "feature" }} -