hugo-theme/layouts/shortcodes/bilibili.html

16 lines
439 B
HTML
Raw Normal View History

2024-10-21 13:47:30 +02:00
{{- $vid := .Get "id" | default (.Get 0) -}}
{{ $q := "" }}
{{ if strings.HasPrefix (lower $vid) "bv" }}
{{ $q = querify "bvid" $vid }}
{{ else }}
{{ $q = querify "aid" $vid }}
{{ end }}
<div class="w-full aspect-video">
<iframe class="w-full aspect-video"
src="//player.bilibili.com/player.html?{{ $q | safeURL }}&p=1"
scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true">
</iframe>
</div>