mirror of https://github.com/onweru/compose.git

weru
26.35.2021 2ab07aa9127b5acca067e7b4b067dc4be977fa38
update shortcode
1 files modified
4 ■■■■ changed files
layouts/shortcodes/youtube.html 4 ●●●● patch | view | raw | blame | history
layouts/shortcodes/youtube.html
@@ -1,4 +1,8 @@
{{- $youtubeHost := "https://www.youtube.com/watch?v=" }}
{{- $url := .Get 0 }}
{{- if in $url $youtubeHost }}
  {{- $url = strings.TrimPrefix $youtubeHost $url }}
{{- end }}
<div class="video">
  <iframe src="https://www.youtube.com/embed/{{ $url }}?controls=1&rel=0"></iframe>
</div>