diff options
Diffstat (limited to 'themes/default/layouts/partials/video-container.html')
-rw-r--r-- | themes/default/layouts/partials/video-container.html | 18 |
1 files 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 -}} |