diff options
author | Tim Keller <tjkeller.xyz> | 2025-01-13 22:08:27 -0600 |
---|---|---|
committer | Tim Keller <tjkeller.xyz> | 2025-01-13 22:08:27 -0600 |
commit | 4901b6b3de685532428ff4275481c1f6971e18f1 (patch) | |
tree | f58ee0f7434637415855ac9c3bc824cd980afdf6 | |
parent | 675e39fa962b30ee013d1feb0aa148b4ebdd1837 (diff) | |
download | hugo-theme-tjkbasic-4901b6b3de685532428ff4275481c1f6971e18f1.tar.xz hugo-theme-tjkbasic-4901b6b3de685532428ff4275481c1f6971e18f1.zip |
-rw-r--r-- | layouts/shortcodes/img.html | 5 | ||||
-rw-r--r-- | static/stylesheets/style.css | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/layouts/shortcodes/img.html b/layouts/shortcodes/img.html index 56bf22f..a57e1ed 100644 --- a/layouts/shortcodes/img.html +++ b/layouts/shortcodes/img.html @@ -4,6 +4,7 @@ <!-- Get parameters --> {{- $alt := .Get "alt" | default "" -}} +{{- $caption := .Get "caption" | default "" -}} {{- $rotation := .Get "rotation" | default 0 -}} <!-- Get quality --> @@ -30,5 +31,7 @@ <figure> <img src="{{ $image.RelPermalink }}" title="{{ $alt }}" alt="{{ $alt }}" /> - <figcaption>{{ $alt }}</figcaption> + {{- if ne $caption "" -}} + <figcaption>{{ $caption }}</figcaption> + {{- end -}} </figure> diff --git a/static/stylesheets/style.css b/static/stylesheets/style.css index 4c32ae3..cd9981b 100644 --- a/static/stylesheets/style.css +++ b/static/stylesheets/style.css @@ -130,7 +130,7 @@ img, figcaption { margin: auto; display: block; width: fit-content; - max-width: 95%; + max-width: 60%; color: #ddd; } @@ -188,4 +188,7 @@ td.img { ol, ul, pre code { margin-left: 0; } + img, figcaption { + max-width: 95%; + } } |