From 82ae0f49e3580afa80b3b597c73e760b92367347 Mon Sep 17 00:00:00 2001 From: Justin Too Date: Mon, 23 Jan 2017 12:40:12 -0800 Subject: [PATCH] Add page hero video for vimeo/youtube using embedresponsively.com code --- _includes/page__hero_video.html | 4 ++ _includes/responsive_video | 11 ++++ _layouts/single.html | 4 +- _sass/_utilities.scss | 25 ++++++++- docs/_docs/14-helpers.md | 12 ++++- docs/_includes/page__hero_video.html | 4 ++ docs/_includes/responsive_video | 11 ++++ docs/_layouts/single.html | 4 +- docs/_posts/2017-01-23-layout-header-video.md | 51 +++++++++++++++++++ docs/_sass/_utilities.scss | 25 ++++++++- 10 files changed, 146 insertions(+), 5 deletions(-) create mode 100644 _includes/page__hero_video.html create mode 100644 _includes/responsive_video create mode 100644 docs/_includes/page__hero_video.html create mode 100644 docs/_includes/responsive_video create mode 100644 docs/_posts/2017-01-23-layout-header-video.md diff --git a/_includes/page__hero_video.html b/_includes/page__hero_video.html new file mode 100644 index 000000000000..ebb11a5b54dc --- /dev/null +++ b/_includes/page__hero_video.html @@ -0,0 +1,4 @@ +{% capture video_id %}{{ page.header.video.id }}{% endcapture %} +{% capture video_provider %}{{ page.header.video.provider }}{% endcapture %} + +{% include responsive_video id=video_id provider=video_provider %} diff --git a/_includes/responsive_video b/_includes/responsive_video new file mode 100644 index 000000000000..f7361079f7dc --- /dev/null +++ b/_includes/responsive_video @@ -0,0 +1,11 @@ +{% capture video_id %}{{ include.id }}{% endcapture %} +{% capture video_provider %}{{ include.provider }}{% endcapture %} + + +
+{% if video_provider == "vimeo" %} + +{% elsif video_provider == "youtube" %} + +{% endif %} +
diff --git a/_layouts/single.html b/_layouts/single.html index 9035528590b6..599135026fb9 100644 --- a/_layouts/single.html +++ b/_layouts/single.html @@ -4,6 +4,8 @@ {% if page.header.overlay_color or page.header.overlay_image or page.header.image %} {% include page__hero.html %} +{% elsif page.header.video.id and page.header.video.provider %} + {% include page__hero_video.html %} {% endif %} {% if page.url != "/" and site.breadcrumbs %} @@ -71,4 +73,4 @@