summaryrefslogtreecommitdiff
path: root/layouts/shortcodes
diff options
context:
space:
mode:
authormms <michal@sapka.me>2024-03-09 20:56:11 +0100
committermms <michal@sapka.me>2024-03-09 20:59:15 +0100
commit6fbc82b77e5de58d60d13ce6e5f0aef433caf9a4 (patch)
tree6247698f41450afa4a2deca80d274af566ac8a37 /layouts/shortcodes
parent26103a8b78ec7f8e882bbf435571e640b6da26db (diff)
feat: remove relative images from shortcode images
Diffstat (limited to 'layouts/shortcodes')
-rw-r--r--layouts/shortcodes/categories.html2
-rw-r--r--layouts/shortcodes/img-c.html8
-rw-r--r--layouts/shortcodes/img-center.html6
-rw-r--r--layouts/shortcodes/img-pull-right.html4
-rw-r--r--layouts/shortcodes/img-r.html4
-rw-r--r--layouts/shortcodes/imgproc.html2
-rw-r--r--layouts/shortcodes/svg-full-width.html3
-rw-r--r--layouts/shortcodes/svg-raw.html9
-rw-r--r--layouts/shortcodes/youtube.html4
-rw-r--r--layouts/shortcodes/yt.html4
10 files changed, 25 insertions, 21 deletions
diff --git a/layouts/shortcodes/categories.html b/layouts/shortcodes/categories.html
index c114f15..1a3b233 100644
--- a/layouts/shortcodes/categories.html
+++ b/layouts/shortcodes/categories.html
@@ -1,7 +1,7 @@
{{ range $name, $taxonomy := .Site.Taxonomies.category }}
{{ $cnt := .Count }}
{{ with $.Site.GetPage (printf "/category/%s" $name) }}
- <a href={{ .RelPermalink }} title="All pages with tag <i>{{$name}}</i>">{{$name}}</a>
+ <a href={{ .Permalink }} title="All pages with tag <i>{{$name}}</i>">{{$name}}</a>
<sup>{{$cnt}}</sup>
{{end}}
{{ end }}
diff --git a/layouts/shortcodes/img-c.html b/layouts/shortcodes/img-c.html
index a05617f..ff262c7 100644
--- a/layouts/shortcodes/img-c.html
+++ b/layouts/shortcodes/img-c.html
@@ -7,14 +7,14 @@
{{- $img1x := $img.Resize "800x webp q90"}}
{{- $img2x := $img.Resize "1600x webp q90"}}
<figure>
- <a href="{{ $img.RelPermalink }}">
+ <a href="{{ $img.Permalink }}">
<img
class="center {{ $imgclass }}"
alt="{{ $caption }}"
- src="{{ $img1x.RelPermalink }}"
+ src="{{ $img1x.Permalink }}"
srcset="
- {{ $img1x.RelPermalink }} 1x,
- {{ $img2x.RelPermalink }} 2x
+ {{ $img1x.Permalink }} 1x,
+ {{ $img2x.Permalink }} 2x
"
width="{{ $img1x.Width }}"
height="{{ $img1x.Height }}"
diff --git a/layouts/shortcodes/img-center.html b/layouts/shortcodes/img-center.html
index 7799d07..587e2b2 100644
--- a/layouts/shortcodes/img-center.html
+++ b/layouts/shortcodes/img-center.html
@@ -9,10 +9,10 @@
<img
class="center"
alt="{{ $caption }}"
- src="{{ $img1x.RelPermalink }}"
+ src="{{ $img1x.Permalink }}"
srcset="
- {{ $img1x.RelPermalink }} 1x,
- {{ $img2x.RelPermalink }} 2x
+ {{ $img1x.Permalink }} 1x,
+ {{ $img2x.Permalink }} 2x
"
width="{{ $img1x.Width }}"
height="{{ $img1x.Height }}"
diff --git a/layouts/shortcodes/img-pull-right.html b/layouts/shortcodes/img-pull-right.html
index e57964d..3873d81 100644
--- a/layouts/shortcodes/img-pull-right.html
+++ b/layouts/shortcodes/img-pull-right.html
@@ -9,8 +9,8 @@
alt="{{ $caption }}"
src="{{ $img1x.Permalink }}"
srcset="
- {{ $img1x.RelPermalink }} 1x,
- {{ $img2x.RelPermalink }} 2x
+ {{ $img1x.Permalink }} 1x,
+ {{ $img2x.Permalink }} 2x
"
width="{{ $img1x.Width }}"
height="{{ $img1x.Height }}"
diff --git a/layouts/shortcodes/img-r.html b/layouts/shortcodes/img-r.html
index 4340792..1791ed7 100644
--- a/layouts/shortcodes/img-r.html
+++ b/layouts/shortcodes/img-r.html
@@ -9,8 +9,8 @@
alt="{{ $caption }}"
src="{{ $img1x.Permalink }}"
srcset="
- {{ $img1x.RelPermalink }} 1x,
- {{ $img2x.RelPermalink }} 2x
+ {{ $img1x.Permalink }} 1x,
+ {{ $img2x.Permalink }} 2x
"
width="{{ $img1x.Width }}"
height="{{ $img1x.Height }}"
diff --git a/layouts/shortcodes/imgproc.html b/layouts/shortcodes/imgproc.html
index c0559fe..115da4d 100644
--- a/layouts/shortcodes/imgproc.html
+++ b/layouts/shortcodes/imgproc.html
@@ -15,7 +15,7 @@
{{ errorf "Invalid image processing command: Must be one of Crop, Fit, Fill or Resize."}}
{{ end }}
<figure>
- <img class="centered" alt="{{ $caption }}" src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}">
+ <img class="centered" alt="{{ $caption }}" src="{{ $img.Permalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}">
<figcaption>
{{ $caption }}
diff --git a/layouts/shortcodes/svg-full-width.html b/layouts/shortcodes/svg-full-width.html
index 4c604ab..affb1d1 100644
--- a/layouts/shortcodes/svg-full-width.html
+++ b/layouts/shortcodes/svg-full-width.html
@@ -7,8 +7,7 @@
<img
class="center"
alt="{{ $caption }}"
- src="{{ $img.RelPermalink }}"
-
+ src="{{ $img.Permalink }}"
>
<figcaption>
{{ $caption }}
diff --git a/layouts/shortcodes/svg-raw.html b/layouts/shortcodes/svg-raw.html
index 950c4f5..701875a 100644
--- a/layouts/shortcodes/svg-raw.html
+++ b/layouts/shortcodes/svg-raw.html
@@ -1,3 +1,8 @@
+
{{- $file := .Get 0 }}
-{{- $path := printf "assets/content_images/%s" $file}}
-{{ $path | readFile | safeHTML }}
+{{- $path := printf "content_images/%s" $file}}
+{{- $img := resources.Get $path }}
+<img
+ class="center"
+ src="{{ $img.Permalink }}"
+ >
diff --git a/layouts/shortcodes/youtube.html b/layouts/shortcodes/youtube.html
index 7e175c5..b59cac1 100644
--- a/layouts/shortcodes/youtube.html
+++ b/layouts/shortcodes/youtube.html
@@ -11,8 +11,8 @@
class="center"
src="{{ $img1x.Permalink }}"
srcset="
- {{ $img1x.RelPermalink }} 1x,
- {{ $img2x.RelPermalink }} 2x
+ {{ $img1x.Permalink }} 1x,
+ {{ $img2x.Permalink }} 2x
"
width="{{ $img1x.Width }}"
height="{{ $img1x.Height }}"
diff --git a/layouts/shortcodes/yt.html b/layouts/shortcodes/yt.html
index 3c5837f..5c4ea21 100644
--- a/layouts/shortcodes/yt.html
+++ b/layouts/shortcodes/yt.html
@@ -11,8 +11,8 @@
class="center"
src="{{ $img1x.Permalink }}"
srcset="
- {{ $img1x.RelPermalink }} 1x,
- {{ $img2x.RelPermalink }} 2x
+ {{ $img1x.Permalink }} 1x,
+ {{ $img2x.Permalink }} 2x
"
width="{{ $img1x.Width }}"
height="{{ $img1x.Height }}"