1
0
mirror of https://github.com/PrivSec-dev/privsec.dev synced 2025-02-20 18:31:35 -05:00

improve youtube shortcode

This commit is contained in:
Wonderfall 2022-07-22 04:18:13 +02:00
parent 7adcdaf982
commit e6f324ec6e
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,15 @@
.youtube-embed-div {
position: relative;
padding-bottom: 56.25%;
height: 0;
overflow: hidden;
}
.youtube-embed-frame {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 0;
}

View File

@ -0,0 +1,4 @@
{{- $id := .Get "id" | default (.Get 0) -}}
<div class="youtube-embed-div">
<iframe src="https://www.youtube-nocookie.com/embed/{{ $id }}" class="youtube-embed-frame" allowfullscreen title="YouTube Video"></iframe>
</div>