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-04-08 01:31:56 +0300
committerIvan Boothe <git@rootwork.org>2022-04-08 01:31:56 +0300
commitf940cc910a6919e072e406fb25c39b78cc8705dd (patch)
tree2878c4c00042a3ee5e89b9417775162a82277541
parent7f980daaa6dbb6823a7ce1474e2329022408947a (diff)
placing remote images in 'images' subdir when loaded
Signed-off-by: Ivan Boothe <git@rootwork.org>
-rw-r--r--layouts/_default/_markup/render-image.html2
-rw-r--r--layouts/partials/image.html2
2 files changed, 4 insertions, 0 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
index fd55c66..1b5fc81 100644
--- a/layouts/_default/_markup/render-image.html
+++ b/layouts/_default/_markup/render-image.html
@@ -18,6 +18,8 @@
{{- if strings.HasPrefix $file "http" -}}
{{- $scratch.Add "classes" " image_external" -}}
{{- $image = resources.GetRemote $file -}}
+ {{- $file = path.Join "images" $image -}}
+ {{- $image = $image.Content | resources.FromString $file -}}
{{- else -}}
{{- $scratch.Add "classes" " image_internal" -}}
{{ $file = (path.Clean $file) }}
diff --git a/layouts/partials/image.html b/layouts/partials/image.html
index b0691cc..f62618d 100644
--- a/layouts/partials/image.html
+++ b/layouts/partials/image.html
@@ -25,6 +25,8 @@
{{- if strings.HasPrefix $file "http" -}}
{{- $scratch.Add "classes" " image_external" -}}
{{- $image = resources.GetRemote $file -}}
+ {{- $file = path.Join "images" $image -}}
+ {{- $image = $image.Content | resources.FromString $file -}}
{{- else -}}
{{- $scratch.Add "classes" " image_internal" -}}
{{ $file = (path.Join "/" $file) }}