diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 2278fe2..bf79a5d 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -18,7 +18,9 @@
{{ with .Resources.GetMatch "feature" }} -{{ partial "featured_media.html" . }} +
+ {{ partial "figure.html" . }} +
{{ end }} {{ .Content }} diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 469793e..ecea82a 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -12,7 +12,9 @@ {{ partial "post-metadata.html" . }} {{ with .Resources.GetMatch "feature" }} - {{ partial "featured_media.html" . }} +
+ {{ partial "figure.html" . }} +
{{ end }}
diff --git a/layouts/partials/featured_media.html b/layouts/partials/featured_media.html deleted file mode 100644 index 3212e03..0000000 --- a/layouts/partials/featured_media.html +++ /dev/null @@ -1,18 +0,0 @@ -
-
- {{ $media := . | resources.Fingerprint "sha512" }} - {{ if eq .MediaType.MainType "image" }} - {{ $media.Title }} - {{ else if eq .MediaType.MainType "video" }} - - {{ end }} - - {{ with $media.Title }} -
- {{ . | markdownify }} -
- {{ end }} -
-
diff --git a/layouts/partials/figure.html b/layouts/partials/figure.html new file mode 100644 index 0000000..1d0804f --- /dev/null +++ b/layouts/partials/figure.html @@ -0,0 +1,17 @@ +
+ {{ $media := . | resources.Fingerprint "sha512" }} + {{ if eq .MediaType.MainType "image" }} + {{ $media.Title }} + {{ else if eq .MediaType.MainType "video" }} + + {{ end }} + + {{ with $media.Title }} +
+ {{ . | markdownify }} +
+ {{ end }} +
diff --git a/layouts/shortcodes/figimage.html b/layouts/shortcodes/figimage.html deleted file mode 100644 index 49699d1..0000000 --- a/layouts/shortcodes/figimage.html +++ /dev/null @@ -1,22 +0,0 @@ -
- - {{ $img := $.Page.Resources.GetMatch (.Get "src") | resources.Fingerprint "sha512" }} - - {{ if .Get "href" }}{{ end }} - {{ . }} - {{ if .Get "href" }}{{ end }} - - {{ with $img.Title }} -
- {{ . | markdownify }} -
- {{ end }} - -
diff --git a/layouts/shortcodes/figure.html b/layouts/shortcodes/figure.html new file mode 100644 index 0000000..d364561 --- /dev/null +++ b/layouts/shortcodes/figure.html @@ -0,0 +1,2 @@ +{{ $resource := $.Page.Resources.GetMatch (.Get "src") }} +{{ partial "figure.html" $resource }} diff --git a/layouts/shortcodes/figvideo.html b/layouts/shortcodes/figvideo.html deleted file mode 100644 index 6c7e041..0000000 --- a/layouts/shortcodes/figvideo.html +++ /dev/null @@ -1,18 +0,0 @@ -
- - {{ $vid := $.Page.Resources.GetMatch (.Get "src") | resources.Fingerprint "sha512" }} - - {{ if .Get "href" }}{{ end }} - - {{ if .Get "href" }}{{ end }} - - {{ with $vid.Title }} -
- {{ . | markdownify }} -
- {{ end }} - -