Permalink
Browse files

Add video shortcode and remove image shadow

  • Loading branch information...
gcushen committed Jan 28, 2018
1 parent b02f5ec commit 66b71fa2f6a41f26d6c3b202fef212fab151112e
Showing with 19 additions and 3 deletions.
  1. +7 −3 layouts/partials/css/academic.css
  2. +12 −0 layouts/shortcodes/video.html
@@ -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,
@@ -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>

0 comments on commit 66b71fa

Please sign in to comment.