mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-23 18:31:45 +01:00
feat(article): add video shortcode (#280)
This commit is contained in:
parent
8d0c65c374
commit
99c4c89f0a
2 changed files with 14 additions and 1 deletions
|
@ -385,7 +385,7 @@
|
||||||
padding-bottom: 56.25%;
|
padding-bottom: 56.25%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
& > iframe {
|
& > iframe, & > video {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
13
layouts/shortcodes/video.html
Normal file
13
layouts/shortcodes/video.html
Normal 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>
|
Loading…
Reference in a new issue