-
Notifications
You must be signed in to change notification settings - Fork 25.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add responsive video header and include with docs #788
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% capture video_id %}{{ include.id }}{% endcapture %} | ||
{% capture video_provider %}{{ include.provider }}{% endcapture %} | ||
|
||
<!-- Courtesy of embedresponsively.com //--> | ||
<div class="responsive-video-container"> | ||
{% if video_provider == "vimeo" %} | ||
<iframe src="http://player.vimeo.com/video/{{ video_id }}" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> | ||
{% elsif video_provider == "youtube" %} | ||
<iframe src="https://www.youtube.com/embed/{{ video_id }}" frameborder="0" allowfullscreen></iframe> | ||
{% endif %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% capture video_id %}{{ include.id }}{% endcapture %} | ||
{% capture video_provider %}{{ include.provider }}{% endcapture %} | ||
|
||
<!-- Courtesy of embedresponsively.com //--> | ||
<div class="responsive-video-container"> | ||
{% if video_provider == "vimeo" %} | ||
<iframe src="http://player.vimeo.com/video/{{ video_id }}" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe> | ||
{% elsif video_provider == "youtube" %} | ||
<iframe src="https://www.youtube.com/embed/{{ video_id }}" frameborder="0" allowfullscreen></iframe> | ||
{% endif %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- | ||
title: "Layout: Header Video" | ||
header: | ||
video: | ||
id: XsxDH4HcOWA | ||
provider: youtube | ||
categories: | ||
- Layout | ||
- Uncategorized | ||
tags: | ||
- video | ||
- layout | ||
--- | ||
|
||
This post should display a **header with a reponsive video**, if the theme supports it. | ||
|
||
## Settings | ||
|
||
|--- | ||
| Parameter | Required | Description | | ||
|-|- | ||
| `id` | **Required** | ID of the video | ||
| `provider` | **Required** | Hosting provider of the video, either 'youtube' or 'vimeo' | ||
|--- | ||
|
||
## YouTube | ||
|
||
Here is a YouTube example for the video at url `https://www.youtube.com/watch?v=XsxDH4HcOWA` (long version) or `https://youtu.be/XsxDH4HcOWA` (short version): | ||
|
||
```yaml | ||
header: | ||
video: | ||
id: XsxDH4HcOWA | ||
provider: youtube | ||
``` | ||
|
||
{% include responsive_video id="XsxDH4HcOWA" provider="youtube" %} | ||
|
||
## Vimeo | ||
|
||
Here is a Vimeo example for the video at url `https://vimeo.com/97649261`: | ||
|
||
```yaml | ||
header: | ||
video: | ||
id: 97649261 | ||
provider: vimeo | ||
``` | ||
|
||
{% include responsive_video id="97649261" provider="vimeo" %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey should these be protocol relative? This breaks when served over HTTPS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it should be protocol relative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incoming pull
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just do
https://
, I just checked the embeds on Vimeo and that's what they default to. The YouTube one is that way as well.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done