Skip to content

Commit ed6dc53

Browse files
committed
feat: add embed video support
1 parent 8de1abd commit ed6dc53

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

_includes/embed/twitch.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<iframe class="embed-video twitch lazyload"
2+
src="https://player.twitch.tv/?video={{ include.id }}&parent={{ site.url | split: '://' | last | remove: '/' }}"
3+
frameborder="0" allowfullscreen="true"
4+
scrolling="no"></iframe>

_includes/embed/youtube.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<iframe class="embed-video youtube lazyload"
2+
src="https://www.youtube.com/embed/{{ include.id }}"
3+
title="YouTube video player"
4+
frameborder="0"
5+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
6+
allowfullscreen></iframe>

_sass/addon/commons.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,21 @@ i { /* fontawesome icons */
576576
}
577577
}
578578

579+
.embed-video {
580+
width: 100%;
581+
height: 100%;
582+
border-radius: 4px;
583+
margin-bottom: 1rem;
584+
585+
&.youtube {
586+
aspect-ratio: 16 / 9;
587+
}
588+
589+
&.twitch {
590+
aspect-ratio: 310 / 189;
591+
}
592+
}
593+
579594
/* --- buttons --- */
580595
.btn-lang {
581596
border: 1px solid !important;

0 commit comments

Comments
 (0)