feat(article): add video shortcode (#280)

This commit is contained in:
zhixuan 2021-07-27 17:42:06 +09:00 committed by GitHub
parent 8d0c65c374
commit 99c4c89f0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View File

@ -385,7 +385,7 @@
padding-bottom: 56.25%;
overflow: hidden;
& > iframe {
& > iframe, & > video {
position: absolute;
width: 100%;
height: 100%;

View File

@ -0,0 +1,13 @@
<div class="video-wrapper">
<video
controls
{{ with .Get "poster" }}poster="{{- . -}}"{{ end }}
{{ with .Get "src" }}src="{{- . -}}"{{ end }}
{{ with .Get "autoplay" }}autoplay{{ end }}
>
<p>
Your browser doesn't support HTML5 video. Here is a
<a href="{{ with .Get "src" }}{{- . -}}{{ end }}">link to the video</a> instead.
</p>
</video>
</div>