From a01da17f264b626429c30593462770331721dc6e Mon Sep 17 00:00:00 2001 From: Gregory Trolliet Date: Thu, 7 May 2020 09:48:29 +0200 Subject: [PATCH] [SHORTCODE] Use img instead of figure, adapt css for attribution --- layouts/shortcodes/img.html | 30 ++++++++++++++++++++---------- static/css/style.css | 5 ++++- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 1231a94..9957c21 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -1,21 +1,31 @@ {{ $img := $.Page.Resources.GetMatch (.Get "src")}} -{{ $test := $img.Permalink }} -{{ $name_splitted := split $img.RelPermalink "." }} -{{ $name_base := index $name_splitted 0 }}
{{ with .Get "link" }} - + {{ end }} - - - {{.Get - + {{ . }} {{ with .Get "link" }} {{ end }} - {{ with .Get "title" }} + {{ if .Get "caption" }}
-

{{ . }}

+

{{ .Get "caption" }} + {{ if .Get "attr" }} + + {{ with .Get "attrlink" }} + + {{ end }} + {{ .Get "attr" }} + {{ with .Get "attrlink" }} + + {{ end }} + + {{ end }} +

{{ end }}
diff --git a/static/css/style.css b/static/css/style.css index 002b988..c4d3a44 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -526,7 +526,7 @@ a:focus { .article-body figure.border figcaption { background-color: var(--background-color-light); } -.article-body figure a { +.article-body figure>a { display: block; min-height: 100%; } @@ -540,6 +540,9 @@ a:focus { margin-left: 1rem; margin-right: 1rem; } +.article-body figure figcaption .attribution { + float: right; +} @media only screen and (max-width: 320px) { .article-body .footnotes ol { padding-left: 2em;