aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2022-06-25 22:08:15 -0400
committertdro <tdro@noreply.example.com>2022-06-25 22:08:15 -0400
commitd3b2f8b628342413e6488cc0f90cfa7b0d29a85f (patch)
treeeb4f13029ea9f289ea9a105d42797d7c9e28400f
parentface7b570c5f51fb5f972540a5fc205ebfbca207 (diff)
downloadcanory-d3b2f8b628342413e6488cc0f90cfa7b0d29a85f.tar.gz
canory-d3b2f8b628342413e6488cc0f90cfa7b0d29a85f.tar.bz2
canory-d3b2f8b628342413e6488cc0f90cfa7b0d29a85f.zip
themes/default/layouts/partials/video-container: Store origin at media cache path
-rw-r--r--themes/default/layouts/partials/video-container.html18
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 -}}