diff options
author | mms <michal@sapka.me> | 2023-12-21 23:23:35 +0100 |
---|---|---|
committer | mms <michal@sapka.me> | 2023-12-21 23:23:35 +0100 |
commit | a834ab11ba14daf6f1d7c95705c26cb7c4e30507 (patch) | |
tree | ecc054d06d209be4072ae3bfb30c2e5a5775392d /layouts/shortcodes | |
parent | c21c3d8c5448ee14cc923280ac9a1b81f9eeda67 (diff) |
feat: trek to ox-hugo, part 1
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r-- | layouts/shortcodes/img-c.html | 27 | ||||
-rw-r--r-- | layouts/shortcodes/recent-updates.html | 1 | ||||
-rw-r--r-- | layouts/shortcodes/st-logo.html | 1 |
3 files changed, 29 insertions, 0 deletions
diff --git a/layouts/shortcodes/img-c.html b/layouts/shortcodes/img-c.html new file mode 100644 index 0000000..641f5bd --- /dev/null +++ b/layouts/shortcodes/img-c.html @@ -0,0 +1,27 @@ +{{- $file := .Get 0 }} +{{- $path := printf "content_images/%s" $file}} +{{- $img := resources.Get $path }} +{{- $caption := .Inner }} +{{- $source := .Get 1 }} +{{- $img1x := $img.Resize "800x webp q90"}} +{{- $img2x := $img.Resize "1600x webp q90"}} +<figure> + <img + class="center" + alt="{{ $caption }}" + src="{{ $img1x.RelPermalink }}" + srcset=" + {{ $img1x.RelPermalink }} 1x, + {{ $img2x.RelPermalink }} 2x + " + width="{{ $img1x.Width }}" + height="{{ $img1x.Height }}" + > + <figcaption> + {{ $caption }} + + {{- if $source }} + <a href="{{ $source }}" target="_blank" title="source">[source]</a> + {{ end }} + </figcaption> +</figure> diff --git a/layouts/shortcodes/recent-updates.html b/layouts/shortcodes/recent-updates.html index fa98d23..24d3c95 100644 --- a/layouts/shortcodes/recent-updates.html +++ b/layouts/shortcodes/recent-updates.html @@ -1,6 +1,7 @@ {{ $category := .Get 0 }} {{ $filter := slice $category }} {{ $more_link := .Get 1 }} +{{ .Inner }} <nav> {{ range (where .Site.RegularPages ".Params.category" "intersect" $filter) }} diff --git a/layouts/shortcodes/st-logo.html b/layouts/shortcodes/st-logo.html index 8dbb6c1..2958668 100644 --- a/layouts/shortcodes/st-logo.html +++ b/layouts/shortcodes/st-logo.html @@ -1,4 +1,5 @@ {{- $file := .Get 0 }} +{{ $alt := .Inner }} <div style="margin: 0 30%"> {{- $path := printf "assets/content_images/%s" $file}} {{- $path | readFile | safeHTML -}} |