mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-07-22 01:15:56 -04:00
enable AMP on more layouts/pages
This commit is contained in:
@@ -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" . }}
|
||||
Reference in New Issue
Block a user