summaryrefslogtreecommitdiffstats
path: root/themes/danix-xyz-hacker/layouts/shortcodes/video.html
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-22 12:43:22 +0200
committerDanilo M. <danix@danix.xyz>2026-04-22 12:43:22 +0200
commit5b476f8905f411768e23cb01d577a60e5a5fd725 (patch)
tree0a08cc83d809dbea714f52826e822501ee7c0165 /themes/danix-xyz-hacker/layouts/shortcodes/video.html
parent082e9246ffe453031894d32d3cee9d5d1bf2b67a (diff)
downloaddanixxyz-5b476f8905f411768e23cb01d577a60e5a5fd725.tar.gz
danixxyz-5b476f8905f411768e23cb01d577a60e5a5fd725.zip
chore: extract theme into git submodule (danix2-hugo-theme)
Diffstat (limited to 'themes/danix-xyz-hacker/layouts/shortcodes/video.html')
-rw-r--r--themes/danix-xyz-hacker/layouts/shortcodes/video.html37
1 files changed, 0 insertions, 37 deletions
diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/video.html b/themes/danix-xyz-hacker/layouts/shortcodes/video.html
deleted file mode 100644
index 1e2645d..0000000
--- a/themes/danix-xyz-hacker/layouts/shortcodes/video.html
+++ /dev/null
@@ -1,37 +0,0 @@
-{{- $src := .Get "src" -}}
-{{- $id := .Get "id" -}}
-{{- $title := .Get "title" | default "Video" -}}
-{{- $class := .Get "class" | default "" -}}
-
-{{- if $id -}}
- <div class="my-6{{- with $class }} {{ . }}{{- end -}}">
- <iframe
- class="w-full aspect-video"
- src="https://www.youtube.com/embed/{{ $id }}"
- title="{{ $title }}"
- allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
- allowfullscreen
- ></iframe>
- </div>
-{{- else if $src -}}
- {{- $ext := $src | path.Ext -}}
- {{- $filetype := slicestr $ext 1 -}}
- {{- $videoURL := $src -}}
- {{- $resource := .Page.Resources.GetMatch $src -}}
- {{- if $resource -}}{{- $videoURL = $resource.RelPermalink -}}{{- end -}}
- <video
- {{- with $class }} class="{{ . }}"{{ end }}
- controls
- preload="auto"
- playsinline
- {{- with .Get "width" }} width="{{ . }}"{{ end }}
- {{- with .Get "height" }} height="{{ . }}"{{ end }}
- {{- if eq (.Get "autoplay") "true" }} autoplay{{ end }}
- {{- if eq (.Get "loop") "true" }} loop{{ end }}
- {{- if eq (.Get "muted") "true" }} muted{{ end }}
- >
- <source src="{{ $videoURL }}" type="video/{{ $filetype }}">
- </video>
-{{- else -}}
- {{- errorf "video shortcode: either 'src' or 'id' parameter is required" -}}
-{{- end -}}