diff options
Diffstat (limited to 'themes/default/layouts/shortcodes')
-rw-r--r-- | themes/default/layouts/shortcodes/attach.html | 8 |
1 files changed, 4 insertions, 4 deletions
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 -}} |