diff options
author | Chip Senkbeil <chip.senkbeil@gmail.com> | 2015-09-28 04:19:31 +0300 |
---|---|---|
committer | Chip Senkbeil <chip.senkbeil@gmail.com> | 2015-09-28 04:19:31 +0300 |
commit | 32849091a6ff3489c8bd987d017de450b1a67f89 (patch) | |
tree | 938df7d6d149a62fc7566c00cd05af680c7812c2 | |
parent | 76c8fd71a5eb0ec5266f7aa02035c8b77e969d87 (diff) |
Updated project items to enable video preview, added poster to video partial
-rw-r--r-- | layouts/partials/extra/video.html | 2 | ||||
-rw-r--r-- | layouts/partials/project/item.html | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/layouts/partials/extra/video.html b/layouts/partials/extra/video.html index 20418d0..14b912e 100644 --- a/layouts/partials/extra/video.html +++ b/layouts/partials/extra/video.html @@ -1,4 +1,4 @@ -<video preload="auto" autoplay loop muted> +<video preload="auto" autoplay loop muted {{ with .Params.video_preview_fallback }}poster="{{ . }}"{{ end }} class="{{ .Scratch.Get "class" }}"> {{ with .Params.video_preview_mp4 }} <source type="video/mp4" src="{{ . }}"> {{ end }} diff --git a/layouts/partials/project/item.html b/layouts/partials/project/item.html index 1706760..c4747a7 100644 --- a/layouts/partials/project/item.html +++ b/layouts/partials/project/item.html @@ -16,7 +16,12 @@ <a href="{{ $link }}"> <div class="project-container rounded-corners z-depth-1"> <div class="project-container-image rounded-corners-top"> - <img src="{{ $image }}" class="fill-container-width rounded-corners-top" /> + {{ if or (isset .Params "video_preview_mp4") (isset .Params "video_preview_ogv") }} + {{ .Scratch.Set "class" "rounded-corners-top fill-container-width" }} + {{ partial "extra/video.html" . }} + {{ else }} + <img src="{{ $image }}" class="fill-container-width rounded-corners-top" /> + {{ end }} </div> <div class="rounded-corners-bottom center-text project-container-title"> <h4 class="white-text">{{ $title }}</h4> |