diff --git a/assets/css/bobastyle.css b/assets/css/bobastyle.css index 1ee68e5..5044719 100644 --- a/assets/css/bobastyle.css +++ b/assets/css/bobastyle.css @@ -28,6 +28,7 @@ .post-media { margin-top: 15px; + display: inline-block; } .post-description { @@ -106,6 +107,10 @@ img:not(.noborder), video:not(.noborder) { border: 5px solid #1b5b9b; } +figure { + margin: auto; +} + figcaption { font-style: italic; font-size: small; diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 119dbde..fd83cf1 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -12,17 +12,24 @@ {{ partial "post-metadata.html" . }} {{ with .Resources.GetMatch "feature" }} - {{ if eq .MediaType.MainType "image" }}
- {{ .Title }} +
+ {{ $media := . | resources.Fingerprint "sha512" }} + {{ if eq .MediaType.MainType "image" }} + {{ $media.Title }} + {{ else if eq .MediaType.MainType "video" }} + + {{ end }} + + {{ with $media.Title }} +
+ {{ . | markdownify }} +
+ {{ end }} +
- {{ else if eq .MediaType.MainType "video" }} -
- -
- {{ end }} {{ end }}
diff --git a/layouts/shortcodes/figimage.html b/layouts/shortcodes/figimage.html new file mode 100644 index 0000000..49699d1 --- /dev/null +++ b/layouts/shortcodes/figimage.html @@ -0,0 +1,22 @@ +
+ + {{ $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 deleted file mode 100644 index a311ce9..0000000 --- a/layouts/shortcodes/figure.html +++ /dev/null @@ -1,26 +0,0 @@ -
- - {{ $img := $.Page.Resources.GetMatch (.Get "resrc") | resources.Fingerprint "sha512" }} - - {{ if .Get "href" }}{{ end }} - {{ with .Get - {{ if .Get "href" }}{{ end }} - - {{ with .Get "caption" }} -
- {{ . | markdownify }} -
- {{ end }} - -
diff --git a/layouts/shortcodes/figvideo.html b/layouts/shortcodes/figvideo.html new file mode 100644 index 0000000..6c7e041 --- /dev/null +++ b/layouts/shortcodes/figvideo.html @@ -0,0 +1,18 @@ +
+ + {{ $vid := $.Page.Resources.GetMatch (.Get "src") | resources.Fingerprint "sha512" }} + + {{ if .Get "href" }}{{ end }} + + {{ if .Get "href" }}{{ end }} + + {{ with $vid.Title }} +
+ {{ . | markdownify }} +
+ {{ end }} + +
diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html deleted file mode 100644 index a3ddf0c..0000000 --- a/layouts/shortcodes/video.html +++ /dev/null @@ -1,4 +0,0 @@ -