Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/chipzoller/hugo-clarity.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Boothe <git@rootwork.org>2022-05-11 00:00:20 +0300
committerIvan Boothe <git@rootwork.org>2022-05-11 00:00:20 +0300
commitc5a826e4d1578c5f187a225c78d9cd249bcae99a (patch)
tree22971a6870dc347cc2a9f129d7451f2cbe5d8921
parent771304dd22a43a4cf068ba6ef51e3d6e9545f60e (diff)
use RelPermalink rather than direct link to images
Signed-off-by: Ivan Boothe <git@rootwork.org>
-rw-r--r--layouts/_default/_markup/render-image.html4
-rw-r--r--layouts/partials/figure.html2
-rw-r--r--layouts/partials/image.html2
3 files changed, 4 insertions, 4 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
index 1b5fc81..a96b4e6 100644
--- a/layouts/_default/_markup/render-image.html
+++ b/layouts/_default/_markup/render-image.html
@@ -26,7 +26,7 @@
{{- if eq $bundle true -}}
{{ $image = .Page.Resources.GetMatch $file }}
{{- if and (not $image) .Page.File -}}
- {{ $file = path.Join .Page.File.Dir $file }}
+ {{ $file = path.Join .Page.RelPermalink $file }}
{{ $image = resources.Get $file }}
{{- end -}}
{{- end -}}
@@ -36,7 +36,7 @@
dict
"file" $file
"image" $image
- "dir" $.Page.File.Dir
+ "dir" $.Page.RelPermalink
"alt" $alt
"cap" $cap
"classes" ($scratch.Get "classes")
diff --git a/layouts/partials/figure.html b/layouts/partials/figure.html
index 8b38535..099a764 100644
--- a/layouts/partials/figure.html
+++ b/layouts/partials/figure.html
@@ -18,7 +18,7 @@
{{- $bundle := .bundle -}}
{{- if eq $bundle true -}}
- {{ $file = path.Join "/" $dir $file }}
+ {{ $file = path.Join $dir $file }}
{{- end -}}
<figure>
diff --git a/layouts/partials/image.html b/layouts/partials/image.html
index 8aed4b6..2292dfe 100644
--- a/layouts/partials/image.html
+++ b/layouts/partials/image.html
@@ -42,7 +42,7 @@
dict
"file" $file
"image" $image
- "dir" $.Page.File.Dir
+ "dir" $.Page.RelPermalink
"alt" $alt
"cap" $cap
"classes" ($scratch.Get "classes")