Skip to content

Commit

Permalink
feat(shortcode): add the poster parameter (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Sep 24, 2024
1 parent 30ee4b3 commit 8695b7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions layouts/partials/video-js/video.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
width="100%"
height="100%"
class="{{ delimit $class ` ` }}"
{{ with .poster }}poster="{{ . }}"{{ end }}
{{ if default false .muted }}muted{{ end }}
{{ if default true .controls }}controls{{ end }}
{{ if default false .loop }}loop{{ end }}
Expand Down
3 changes: 3 additions & 0 deletions layouts/shortcodes/video-js.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- $src := "" }}
{{- $poster := "" }}
{{- $type := "" }}
{{- $muted := false }}
{{- $controls := true }}
Expand All @@ -12,6 +13,7 @@
{{- if .IsNamedParams }}
{{- $src = .Get "src" }}
{{- with .Get "type" }}{{ $type = . }}{{ end }}
{{- with .Get "poster" }}{{ $poster = . }}{{ end }}
{{- if isset .Params "muted" }}{{ $muted = .Get "muted" }}{{ end }}
{{- if isset .Params "controls" }}{{ $controls = .Get "controls" }}{{ end }}
{{- if isset .Params "loop" }}{{ $loop = .Get "loop" }}{{ end }}
Expand All @@ -29,6 +31,7 @@
{{- end }}
{{ partial "video-js/video" (dict
"src" $src
"poster" $poster
"type" $type
"muted" $muted
"controls" $controls
Expand Down

0 comments on commit 8695b7c

Please sign in to comment.