Add video shortcode and remove image shadow

This commit is contained in:
George Cushen committed 2018-01-28 01:14:44 +00:00
1 parent b02f5eceda
commit 66b71fa2f6
2 files changed
+19 -3

No files matched your search

+7 -3
View File
@@ -127,6 +127,12 @@ video {
display: block;
}
video {
width: 100%;
height: auto;
max-height: 400px;
}
.img-responsive {
/* Extend Bootstrap declaration with centering. */
margin: 0 auto;
@@ -652,13 +658,11 @@ article .article-metadata {
.article-style img,
.article-style video {
box-shadow: 1px 1px 0px #edefed, -1px -1px 0px #edefed, 1px -1px 0px #edefed, -1px 1px 0px #edefed;
margin-left: auto;
margin-right: auto;
margin-top: 60px;
margin-bottom: 60px;
padding-left: 0;
padding-right: 0;
padding: 0;
}
.article-style td img,
+12
View File
@@ -0,0 +1,12 @@
{{ $directory := "img/" }}
{{ $video := printf "%s%s" $directory (.Get "src") }}
{{ $video_type := substr (.Get "src") -1 3 }}
{{ $poster := printf "%s%s%s" $directory (substr (.Get "src") 0 -4) ".jpg" }}
{{ if fileExists (printf "%s%s" "static/" $poster) }}
{{ .Scratch.Set "poster" ($poster | absURL) }}
{{ else }}
{{ .Scratch.Set "poster" "" }}
{{ end }}
<video {{if (.Get "controls")}}controls{{else}}autoplay loop{{end}} {{with .Scratch.Get "poster"}}poster="{{.}}"{{end}}>
<source src="{{ $video | relURL }}" type="video/{{$video_type}}">
</video>