diff options
author | Caio Lente <7017340+clente@users.noreply.github.com> | 2024-03-04 16:44:08 -0300 |
---|---|---|
committer | Caio Lente <7017340+clente@users.noreply.github.com> | 2024-03-04 16:44:08 -0300 |
commit | f71c3966872c5f1ff34a7ceb4d9e720b9fad17a5 (patch) | |
tree | fdb4d1a4b66826d28bf0f85056837c0e6004971a /layouts/shortcodes/absfigure.html | |
parent | 5d2a097a0b147ef62f206db3e3895321b6c4f114 (diff) | |
parent | d48d738e2498b728f6014f00e32a35d06e555205 (diff) | |
download | hugo-bearcub-f71c3966872c5f1ff34a7ceb4d9e720b9fad17a5.tar.gz hugo-bearcub-f71c3966872c5f1ff34a7ceb4d9e720b9fad17a5.tar.bz2 |
Merge branch 'style/herman'
Diffstat (limited to 'layouts/shortcodes/absfigure.html')
-rw-r--r-- | layouts/shortcodes/absfigure.html | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/layouts/shortcodes/absfigure.html b/layouts/shortcodes/absfigure.html new file mode 100644 index 0000000..ad60c6c --- /dev/null +++ b/layouts/shortcodes/absfigure.html @@ -0,0 +1,29 @@ +<figure{{ with .Get "class" }} class="{{ . }}"{{ end }}> + {{- if .Get "link" -}} + <a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}> + {{- end -}} + <img src="{{ .Get "src" | absURL}}" + {{- if or (.Get "alt") (.Get "caption") }} + alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}" + {{- end -}} + {{- with .Get "width" }} width="{{ . }}"{{ end -}} + {{- with .Get "height" }} height="{{ . }}"{{ end -}} + {{- with .Get "loading" }} loading="{{ . }}"{{ end -}} + /><!-- Closing img tag --> + {{- if .Get "link" }}</a>{{ end -}} + {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}} + <figcaption> + {{ with (.Get "title") -}} + <h4>{{ . }}</h4> + {{- end -}} + {{- if or (.Get "caption") (.Get "attr") -}}<p> + {{- .Get "caption" | markdownify -}} + {{- with .Get "attrlink" }} + <a href="{{ . }}"> + {{- end -}} + {{- .Get "attr" | markdownify -}} + {{- if .Get "attrlink" }}</a>{{ end }}</p> + {{- end }} + </figcaption> + {{- end }} +</figure>
\ No newline at end of file |