From b8b1cba41c944610f4d51d6368902425d5c32143 Mon Sep 17 00:00:00 2001 From: tdro Date: Thu, 2 Nov 2023 11:11:08 -0400 Subject: themes/default/layouts: Namespacing --- themes/default/layouts/shortcodes/attach.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'themes/default/layouts/shortcodes') diff --git a/themes/default/layouts/shortcodes/attach.html b/themes/default/layouts/shortcodes/attach.html index dfd472f..238e0cd 100644 --- a/themes/default/layouts/shortcodes/attach.html +++ b/themes/default/layouts/shortcodes/attach.html @@ -10,8 +10,8 @@ {{- $immutable := print $url | anchorize -}} {{- $localFile := path.Join "public/" $url -}} {{- $type := "application/octet-stream" -}} -{{- $fileCache := print $author "/media/" $immutable $extension -}} -{{- $cached := fileExists (path.Join "public/" $fileCache) -}} +{{- $storage := print $author "/media/" $immutable $extension -}} +{{- $cached := fileExists (path.Join "public/" $storage) -}} {{- if not $cached -}} {{- with $remote := cond (default true $.Page.Site.Params.site.offline) false (resources.GetRemote $url) -}} @@ -22,7 +22,7 @@ {{- end -}} {{- else -}} {{- $type = $remote.MediaType -}} - {{- $cache = $remote | resources.Copy $fileCache -}} + {{- $cache = $remote | resources.Copy $storage -}} {{- $cache = $cache.Permalink -}} {{- end -}} {{- else -}} @@ -30,7 +30,7 @@ {{- warnf "Attachment remote fetch error: %s" $url -}} {{- end -}} {{- else -}} - {{- with $cache = resources.Get (path.Join "public/" $fileCache) -}} + {{- with $cache = resources.Get (path.Join "public/" $storage) -}} {{- $type = .MediaType -}} {{- $cache = print ("" | absURL) (strings.TrimLeft "public" $cache) -}} {{- end -}} -- cgit v1.2.3