From 2d3bfb0ddc97bb6c147965bb1bb8a515c96f1192 Mon Sep 17 00:00:00 2001 From: tdro Date: Mon, 5 Sep 2022 15:51:18 -0400 Subject: themes/default/layouts/shortcodes/video: Set orientation --- assets/css/default.css | 10 +++++ .../default/layouts/partials/video-container.html | 4 +- themes/default/layouts/shortcodes/video.html | 46 +++++++++++----------- 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/assets/css/default.css b/assets/css/default.css index dbb0592..4fa6ece 100644 --- a/assets/css/default.css +++ b/assets/css/default.css @@ -281,6 +281,7 @@ blockquote p span { video { border-radius: 0.5rem; + background-color: #000; } video:hover { @@ -288,6 +289,15 @@ video:hover { box-shadow: 0 0 14px var(--shadow); } +video[data-orientation="portrait"] { + width: 50%; +} + +video-container { + display: block; + text-align: center; +} + kbd { background-color: #eee; border-radius: 0.25rem; diff --git a/themes/default/layouts/partials/video-container.html b/themes/default/layouts/partials/video-container.html index d114332..cf5c20e 100644 --- a/themes/default/layouts/partials/video-container.html +++ b/themes/default/layouts/partials/video-container.html @@ -5,8 +5,9 @@ {{- $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 not (fileExists (path.Join "public/" $fileCache)) -}} +{{- if $notCached -}} {{- with $remote := resources.GetRemote .Source -}} {{- with .Err -}} {{- if fileExists $public -}} @@ -30,6 +31,7 @@