diff options
author | Przemysław Kołodziejczyk <eshlox@vertolabs.com> | 2018-05-05 12:35:46 +0300 |
---|---|---|
committer | Przemysław Kołodziejczyk <eshlox@vertolabs.com> | 2018-05-05 12:35:46 +0300 |
commit | 2ce181490572d6d7d180b3bf4e2cf676bb00b5eb (patch) | |
tree | 5c382f940144fab08ced0160cec9ecb48b623ef3 | |
parent | 0009a0c5a0204428bbb65340e6b84e4f84af48f6 (diff) |
Video shortcode
-rw-r--r-- | exampleSite/content/media/video.mp4 | bin | 0 -> 1055736 bytes | |||
-rw-r--r-- | layouts/shortcodes/video.html | 8 | ||||
-rw-r--r-- | src/styles/_components/content.scss | 9 |
3 files changed, 11 insertions, 6 deletions
diff --git a/exampleSite/content/media/video.mp4 b/exampleSite/content/media/video.mp4 Binary files differnew file mode 100644 index 0000000..ed139d6 --- /dev/null +++ b/exampleSite/content/media/video.mp4 diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html index ef6b8cd..15c898d 100644 --- a/layouts/shortcodes/video.html +++ b/layouts/shortcodes/video.html @@ -1,4 +1,8 @@ -<video width="800" height="600" controls> - <source src="{{ .Get 0 }}" type="video/mp4"> +{{ $src := (.Get "src") }} +{{ $width := (.Get "width") }} +{{ $height := (.Get "height") }} + +<video{{ if $width }} width="{{ $width }}"{{ end }}{{ if $height }} height="{{ $height }}"{{end}} controls> + <source src="{{ $src | relURL }}" type="video/mp4"> Your browser does not support the video tag. </video> diff --git a/src/styles/_components/content.scss b/src/styles/_components/content.scss index c873d22..9810c9d 100644 --- a/src/styles/_components/content.scss +++ b/src/styles/_components/content.scss @@ -125,10 +125,11 @@ body { } } - //video { - // display: block; - // margin: 4rem auto; - //} + video { + display: block; + margin: 4rem auto; + width: 100% + } //.youtube { // border: 0; |