Skip to content
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

Added shortcode for embedding YouTube videos at 16:9 #17

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions sass/base.scss
Expand Up @@ -459,6 +459,20 @@ figcaption {
}
}

/* 16:9 Video */
div.video {
position: relative;
padding-top: 56.25%;
}

div.video iframe {
position: absolute;
top:0;
left:0;
width:100%;
height:100%;
}

/* Other pages */
.terms {
list-style-type: none;
Expand Down
10 changes: 10 additions & 0 deletions templates/shortcodes/youtube.html
@@ -0,0 +1,10 @@
<div class="video{% if class %} {{class}}{% endif %}">
<iframe
src="https://www.youtube.com/embed/{{id}}?rel=0{% if autoplay %}&autoplay=1{% endif %}"
allow="autoplay; encrypted-media"
frameborder="0"
webkitallowfullscreen
mozallowfullscreen
allowfullscreen>
</iframe>
</div>