summaryrefslogtreecommitdiff
path: root/themes/blowfish/layouts/shortcodes/screenshot.html
diff options
context:
space:
mode:
authorChristoph Cullmann <cullmann@kde.org>2024-04-28 17:33:09 +0200
committerChristoph Cullmann <cullmann@kde.org>2024-04-28 17:33:09 +0200
commite77051ccc4b47951bfa4fde2be436b1bb2fb113b (patch)
treef0b75ee3521da9c8cd39dac4359212348f70e4e8 /themes/blowfish/layouts/shortcodes/screenshot.html
parent4b355837824ac2422d371acef790f0f4249255c7 (diff)
use https://github.com/nunocoracao/blowfish.git
Diffstat (limited to 'themes/blowfish/layouts/shortcodes/screenshot.html')
-rw-r--r--themes/blowfish/layouts/shortcodes/screenshot.html22
1 files changed, 22 insertions, 0 deletions
diff --git a/themes/blowfish/layouts/shortcodes/screenshot.html b/themes/blowfish/layouts/shortcodes/screenshot.html
new file mode 100644
index 0000000..39640ac
--- /dev/null
+++ b/themes/blowfish/layouts/shortcodes/screenshot.html
@@ -0,0 +1,22 @@
+{{ if .Get "src" }}
+ {{ $image := .Page.Resources.GetMatch (printf "*%s*" (.Get "src")) }}
+ <figure{{ with .Get "class" }} class="{{ . }}"{{ end }}>
+ {{- if .Get "href" -}}
+ <a href="{{ .Get "href" }}">
+ {{- end -}}
+ <img src="{{ $image.RelPermalink }}"
+ {{- if or (.Get "alt") (.Get "caption") }}
+ alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify | plainify }}{{ end }}"
+ {{- end -}}
+ width="100%"
+ height="auto"
+ style="max-width:{{ div $image.Width 2 }}px; max-height:{{ div $image.Height 2 }}px;"
+ />
+ {{- if .Get "href" }}</a>{{ end -}}
+ {{- if .Get "caption" -}}
+ <figcaption>
+ {{- .Get "caption" | markdownify -}}
+ </figcaption>
+ {{- end }}
+ </figure>
+{{ end }}