enable AMP on more layouts/pages

This commit is contained in:
2020-11-08 11:12:21 -05:00
parent b378cb4afb
commit 6ada1afd4a
10 changed files with 364 additions and 292 deletions
+28
View File
@@ -0,0 +1,28 @@
{{ partial "amp/head" . }}
<article class="layout layout-video">
{{ with .OutputFormats.Get "html" }}
<h1 class="title"><a href="{{ .Permalink }}">{{ $.Title | markdownify }}</a></h1>
{{ end }}
<amp-video
layout="responsive"
width="940"
height="530"
{{ with .Resources.GetMatch "thumb.*" }}poster="{{ .Permalink }}"{{ end }}
controls>
{{ with .Page.Resources.GetMatch "*.webm" }}<source src="{{ .Permalink }}" type="video/webm">{{ end }}
{{ with .Page.Resources.GetMatch "*.mp4" }}<source src="{{ .Permalink }}" type="video/mp4">{{ end }}
{{ with .Page.Resources.GetMatch "*.ogg" }}<source src="{{ .Permalink }}" type="video/ogg">{{ end }}
{{ with .Page.Resources.GetMatch "*.vtt" }}<track src="{{ .Permalink }}" kind="captions" label="English" srclang="en" default>{{ end }}
<div fallback>
<p>Your browser does not support HTML5 video. {{ with .Page.Resources.GetMatch "*.mp4" }}<a href="{{ .Permalink }}">Load the .mp4 video directly.</a>{{ end }}</p>
</div>
</amp-video>
{{ .Content }}
</article>
{{ partial "amp/foot" . }}