diff --git a/layouts/partials/css/academic.css b/layouts/partials/css/academic.css index a5d9b0af..4daf2c69 100644 --- a/layouts/partials/css/academic.css +++ b/layouts/partials/css/academic.css @@ -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, diff --git a/layouts/shortcodes/video.html b/layouts/shortcodes/video.html new file mode 100644 index 00000000..f5a7bd67 --- /dev/null +++ b/layouts/shortcodes/video.html @@ -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 }} + \ No newline at end of file