diff options
author | tdro <tdro@noreply.example.com> | 2022-10-11 22:55:52 -0400 |
---|---|---|
committer | tdro <tdro@noreply.example.com> | 2022-10-11 22:55:52 -0400 |
commit | 320c736adaa6374fb0ac9988a64cbb1bd143425b (patch) | |
tree | bfdf35d70011096bdc87860524da5fc9592e8860 /themes/default/layouts/partials/video-container.html | |
parent | 48bac198206fb02e831f1ed982976e8115f076b4 (diff) | |
download | canory-320c736adaa6374fb0ac9988a64cbb1bd143425b.tar.gz canory-320c736adaa6374fb0ac9988a64cbb1bd143425b.tar.bz2 canory-320c736adaa6374fb0ac9988a64cbb1bd143425b.zip |
themes/default/layouts/partials/video-container: Don't leak <nil> into source URL
Diffstat (limited to 'themes/default/layouts/partials/video-container.html')
-rw-r--r-- | themes/default/layouts/partials/video-container.html | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/themes/default/layouts/partials/video-container.html b/themes/default/layouts/partials/video-container.html index cf5c20e..488d4ec 100644 --- a/themes/default/layouts/partials/video-container.html +++ b/themes/default/layouts/partials/video-container.html @@ -1,12 +1,16 @@ {{- $cache := "" -}} +{{- $timestamp := "" -}} {{- $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 -}} {{- $notCached := not (fileExists (path.Join "public/" $fileCache)) -}} +{{- if and .Start .End -}} + {{- $timestamp = print "#t=" .Start "," .End -}} +{{- end -}} + {{- if $notCached -}} {{- with $remote := resources.GetRemote .Source -}} {{- with .Err -}} |