diff options
author | Ivan Boothe <git@rootwork.org> | 2022-06-11 00:34:37 +0300 |
---|---|---|
committer | Ivan Boothe <git@rootwork.org> | 2022-06-11 00:34:37 +0300 |
commit | 9eae1ae81ca4b52160fef9706d81b18df50e099a (patch) | |
tree | 8c414a17659aa0843c94eafd57a9f7b4b73ed0d1 /layouts | |
parent | b387006a1dcefb26a1546986c27ff90f3a3a2996 (diff) |
Ensuring image functions read configurable imagesDir path
Signed-off-by: Ivan Boothe <git@rootwork.org>
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/_default/_markup/render-image.html | 3 | ||||
-rw-r--r-- | layouts/partials/image.html | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html index 5ca7332..2ddb29a 100644 --- a/layouts/_default/_markup/render-image.html +++ b/layouts/_default/_markup/render-image.html @@ -1,4 +1,5 @@ {{- $file := .Destination -}} +{{- $imagesDir := .Page.Site.Params.imagesDir -}} {{- $alt := .Text -}} {{- $cap := .Title -}} {{- $scratch := newScratch -}} @@ -24,7 +25,7 @@ {{- $image = "" -}} {{- $scratch.Add "classes" " image_svg" -}} {{- else -}} - {{- $file = path.Join "images" $image -}} + {{- $file = path.Join $imagesDir $image -}} {{- $image = $image.Content | resources.FromString $file -}} {{- end -}} {{- else -}} diff --git a/layouts/partials/image.html b/layouts/partials/image.html index c9b9662..a5cae3e 100644 --- a/layouts/partials/image.html +++ b/layouts/partials/image.html @@ -1,4 +1,5 @@ {{- $file := .file -}} +{{- $imagesDir := .Page.Site.Params.imagesDir -}} {{- $alt := .alt -}} {{- if not $alt -}} {{- $alt = .Text -}} @@ -34,7 +35,7 @@ {{- $image = "" -}} {{- $scratch.Add "classes" " image_svg" -}} {{- else -}} - {{- $file = path.Join "images" $image -}} + {{- $file = path.Join $imagesDir $image -}} {{- $image = $image.Content | resources.FromString $file -}} {{- end -}} {{- else -}} |