summaryrefslogtreecommitdiff
path: root/layouts/shortcodes
diff options
context:
space:
mode:
authorMichał M. Sapka <michal@sapka.me>2023-02-25 19:19:56 +0100
committerMichał M. Sapka <michal@sapka.me>2023-02-25 19:19:56 +0100
commit53634e6fec0e25bb85a0746d256ab72c01b30831 (patch)
tree85be2cb1a8951397a7da7abc6785ebc778cd8caa /layouts/shortcodes
parent02f2b53f642ed69d5f4d94e5e294aa6d030450f0 (diff)
feat: handle images better on small screens
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r--layouts/shortcodes/img-center.html3
-rw-r--r--layouts/shortcodes/youtube.html23
2 files changed, 14 insertions, 12 deletions
diff --git a/layouts/shortcodes/img-center.html b/layouts/shortcodes/img-center.html
index ee6425a..fca4395 100644
--- a/layouts/shortcodes/img-center.html
+++ b/layouts/shortcodes/img-center.html
@@ -5,9 +5,9 @@
{{- $source := .Get 2 }}
{{- $img1x := $img.Resize "500x webp q90"}}
{{- $img2x := $img.Resize "1000x webp q90"}}
+<center>
<figure>
<img
- class="centered"
alt="{{ $caption }}"
src="{{ $img1x.RelPermalink }}"
srcset="
@@ -24,3 +24,4 @@
{{ end }}
</figcaption>
</figure>
+</center>
diff --git a/layouts/shortcodes/youtube.html b/layouts/shortcodes/youtube.html
index a4d419b..4261ed2 100644
--- a/layouts/shortcodes/youtube.html
+++ b/layouts/shortcodes/youtube.html
@@ -6,17 +6,18 @@
{{- $img2x := $img.Resize "x600 webp q90" }}
<center>
-<a href="https://www.youtube.com/watch?v={{$id}}" target="_blank">
- <img
- src="{{ $img1x.Permalink }}"
- srcset="
- {{ $img1x.RelPermalink }} 1x,
- {{ $img2x.RelPermalink }} 2x,
- "
- width="{{ $img1x.Width }}"
- height="{{ $img1x.Height }}"
+ <a href="https://www.youtube.com/watch?v={{$id}}" target="_blank">
+ <img
+ src="{{ $img1x.Permalink }}"
+ srcset="
+ {{ $img1x.RelPermalink }} 1x,
+ {{ $img2x.RelPermalink }} 2x,
+ "
+ width="{{ $img1x.Width }}"
+ height="{{ $img1x.Height }}"
alt="{{$title}} on Youtube"
width="{{$img.Width}}"
- height="{{$img.Height}}"/>
-</a>
+ height="{{$img.Height}}"
+ />
+ </a>
</center>