From d3b2f8b628342413e6488cc0f90cfa7b0d29a85f Mon Sep 17 00:00:00 2001 From: tdro Date: Sat, 25 Jun 2022 22:08:15 -0400 Subject: themes/default/layouts/partials/video-container: Store origin at media cache path --- themes/default/layouts/partials/video-container.html | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/themes/default/layouts/partials/video-container.html b/themes/default/layouts/partials/video-container.html index 2d782e6..f523c89 100644 --- a/themes/default/layouts/partials/video-container.html +++ b/themes/default/layouts/partials/video-container.html @@ -1,10 +1,11 @@ -{{- $cache := "" -}} -{{- $caption := .Caption -}} -{{- $public := print "public/" .Source -}} -{{- $timestamp := print "#t=" .Start "," .End -}} -{{- $immutable := print (.RelURL | humanize | urlize) "-" (.Source | sha256 | truncate 8 "") -}} -{{- $extension := path.Ext .Source -}} -{{- $fileCache := print $.Author "/media/" $immutable $extension -}} +{{- $cache := "" -}} +{{- $caption := .Caption -}} +{{- $public := print "public/" .Source -}} +{{- $timestamp := print "#t=" .Start "," .End -}} +{{- $immutable := print (.RelURL | humanize | urlize) "-" (.Source | sha256 | truncate 8 "") -}} +{{- $extension := path.Ext .Source -}} +{{- $fileCache := print $.Author "/media/" $immutable $extension -}} +{{- $mediaCache := print (partial "function-paths-media.html") "/" $.Author "/" $immutable $extension -}} {{- if not (fileExists (path.Join "public/" $fileCache)) -}} {{- with $remote := resources.GetRemote .Source -}} @@ -14,7 +15,7 @@ {{- $caption = "No local video data found for source" -}} {{- end -}} {{- else -}} - {{- end }} + {{- end -}} {{- $cache = . | resources.Copy $fileCache -}} {{- $cache = $cache.RelPermalink -}} {{- else -}} @@ -22,6 +23,7 @@ {{- end -}} {{- else -}} {{- $cache = resources.Get (path.Join "public/" $fileCache) -}} + {{- $cache = $cache | resources.FromString $mediaCache -}} {{- $cache = $cache.RelPermalink -}} {{- end -}} -- cgit v1.2.3