Skip to content

Commit 2041be5

Browse files
committed
Added youtube iframe template
1 parent 52ac90b commit 2041be5

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

sass/_extra.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,18 @@ h6:hover .anchor {
8888
margin-bottom: 32px;
8989
}
9090
}
91+
92+
.ratio169 {
93+
position: relative;
94+
width: 100%;
95+
height: 0;
96+
padding-bottom: 56.25%;
97+
98+
& > iframe {
99+
position: absolute;
100+
left: 0;
101+
top: 0;
102+
width: 100%;
103+
height: 100%;
104+
}
105+
}

templates/shortcodes/youtube.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<figure class="inline-image">
2+
<div class="ratio169">
3+
<iframe width="100%" src="https://www.youtube.com/embed/{{ id }}" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
4+
</div>
5+
{% if caption %}<figcaption><p>{{caption}}</p></figcaption>{% endif %}
6+
</figure>

0 commit comments

Comments
 (0)