aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThedro Neely <thedroneely@gmail.com>2022-04-02 02:26:30 -0400
committerThedro Neely <thedroneely@gmail.com>2022-04-02 03:19:05 -0400
commit53733f7d389f84174b6c4294a24d3ab70b852d5d (patch)
treef44c93c76c07abd79adae976e8467c6b37eebd59
parentea95b7b32f0bb9870428f377522a4523031a9692 (diff)
downloadthedroneely.com-53733f7d389f84174b6c4294a24d3ab70b852d5d.tar.gz
thedroneely.com-53733f7d389f84174b6c4294a24d3ab70b852d5d.tar.bz2
thedroneely.com-53733f7d389f84174b6c4294a24d3ab70b852d5d.zip
generators/hugo/layouts/shortcodes/video: Set defaults
Use figcaption.
-rw-r--r--app/views/index.view.php7
-rw-r--r--generators/hugo/themes/tdro/layouts/shortcodes/video.html30
-rw-r--r--public/css/tdro.css15
3 files changed, 30 insertions, 22 deletions
diff --git a/app/views/index.view.php b/app/views/index.view.php
index 6bd5f58..7c02198 100644
--- a/app/views/index.view.php
+++ b/app/views/index.view.php
@@ -26,9 +26,12 @@
<video-container>
<video preload="none" poster="/images/pipes.png" width="732" autoplay="true" loop="true" muted="true">
<source src="/videos/pipes.mp4" type="video/mp4" />
- Sorry, your browser doesn't support embedded videos.
+ <p>
+ Sorry, your browser doesn't support embedded videos. Here is a
+ <a href="/videos/pipes.mp4">link to the video</a> instead.
+ </p>
</video>
- <footer class="has-text-grey-dark">pipes.sh terminal screensaver</footer>
+ <figcaption class="has-text-grey-dark">pipes.sh terminal screensaver</figcaption>
</video-container>
<div class="content">
diff --git a/generators/hugo/themes/tdro/layouts/shortcodes/video.html b/generators/hugo/themes/tdro/layouts/shortcodes/video.html
index 719e212..a0bf488 100644
--- a/generators/hugo/themes/tdro/layouts/shortcodes/video.html
+++ b/generators/hugo/themes/tdro/layouts/shortcodes/video.html
@@ -1,12 +1,26 @@
+{{-
+ $source := default
+ "https://raw.githubusercontent.com/benhosmer/HTML5-Test-Videos/9a6c2db46472454c634963cbeb0900fd37901fac/big_buck_bunny"
+ (.Get "source" | default (.Get 0))
+-}}
+{{- $poster := default "" (.Get "poster" | default (.Get 1)) -}}
+{{- $width := default "" (.Get "width" | default (.Get 2)) -}}
+{{- $height := default "" (.Get "height" | default (.Get 3)) -}}
+{{- $preload := default "none" (.Get "preload" | default (.Get 4)) -}}
+{{- $options := default "" (.Get "options" | default (.Get 5)) -}}
+
<video-container>
<video
- preload="none"
- poster="{{ .Get `poster` }}"
- width="{{ .Get `width` }}"
- height="{{ .Get `height`}}"
- controls {{ .Get `options` | safeHTMLAttr }}>
- <source src="{{ .Get `source` }}" type="video/mp4">
- Sorry, your browser doesn't support embedded videos.
+ preload="{{ $preload }}"
+ poster="{{ $poster }}"
+ width="{{ $width }}"
+ height="{{ $height }}"
+ controls {{ $options | safeHTMLAttr }}>
+ <source src="{{ $source }}" type="video/mp4">
+ <p>
+ Sorry, your browser doesn't support embedded videos. Here is a
+ <a href="{{ $source }}">link to the video</a> instead.
+ </p>
</video>
- <footer class="has-text-grey-dark">{{ .Inner | markdownify }}</footer>
+ <figcaption class="has-text-grey-dark">{{ .Inner | markdownify }}</figcaption>
</video-container>
diff --git a/public/css/tdro.css b/public/css/tdro.css
index bd7dabe..acd5754 100644
--- a/public/css/tdro.css
+++ b/public/css/tdro.css
@@ -1926,20 +1926,11 @@ figure div {
height: 0;
}
-figcaption code {
- font-size: 1em;
-}
-
figcaption,
-video ~ footer,
-video ~ footer code {
- font-size: 0.9rem;
-}
-
-figcaption,
-video ~ footer {
- margin-top: 1.5em;
+figcaption code {
+ font-size: 0.95em;
margin-bottom: 1em;
+ margin-top: 1.5em;
text-align: center;
}