refactor templates layout
@see https://gohugo.io/templates/new-templatesystem-overview/
This commit is contained in:
parent
a83f339dc8
commit
230c46411b
102 changed files with 2 additions and 2 deletions
26
layouts/_partials/media/video.html
Normal file
26
layouts/_partials/media/video.html
Normal file
|
@ -0,0 +1,26 @@
|
|||
<!--
|
||||
Render a video in an interactive player.
|
||||
|
||||
@params context Video media file.
|
||||
@params page_file_path Filepath of the calling file for error messages.
|
||||
-->
|
||||
|
||||
{{- $src := .src -}}
|
||||
|
||||
<video
|
||||
class="u-video figure__video"
|
||||
controls
|
||||
itemprop="video"
|
||||
preload="none"
|
||||
src="{{ $src.RelPermalink }}"
|
||||
poster="
|
||||
{{- if $src.Params.poster -}}
|
||||
{{- $posterSrc := $.Page.Resources.GetMatch ( .Get $src.Params.poster ) -}}
|
||||
{{- partialCached "images/get-image.html" ( dict "img" $posterSrc ) $posterSrc.Title -}}
|
||||
{{- else -}}
|
||||
{{- erroridf "a11y-video-poster" "No poster defined for resource %q (%q)" $src.RelPermalink .page_file_path -}}
|
||||
{{- end -}}
|
||||
"
|
||||
>
|
||||
Your browser doesn't support embedded video, <a href="{{ $src.RelPermalink }}">view the video here</a>.
|
||||
</video>
|
Loading…
Add table
Add a link
Reference in a new issue