diff options
-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 -}} |