summaryrefslogtreecommitdiffstats
path: root/themes/danix-xyz-hacker/layouts/shortcodes/video.html
diff options
context:
space:
mode:
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 -}}