-
Notifications
You must be signed in to change notification settings - Fork 732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何插入bilibili视频? #278
Comments
@yezihack 提了一个 PR: feat: support BiliBili video, 利用 Hugo Shortcodes 插入 B 站视频 => Demo 食用方法: 在想插入 B 站视频的地方使用 Shortcodes: {{< bilibili [AV号/BV号] [PV号] >}} (AV 号不带 av/AV,BV 号必须带 bv/BV,PV 号控制分 P,默认为 1) 比如 |
已经解决 |
请问如何设置高度宽度?默认太小了 |
把 {{ $videoID := index .Params 0 }}
{{ $pageNum := index .Params 1 | default 1 }}
{{ if (findRE "^[bB][vV][0-9a-zA-Z]+$" $videoID) }}
<div style="position:relative; padding-bottom:75%; width:100%; height:0">
<iframe
src="//player.bilibili.com/player.html?bvid={{ $videoID }}&page={{ $pageNum }}"
scrolling="no"
border="0"
frameborder="no"
framespacing="0"
allowfullscreen="true"
style="position:absolute; height: 100%; width: 100%;"
>
</iframe>
</div>
{{ else }}
<div style="position:relative; padding-bottom:75%; width:100%; height:0">
<iframe
src="//player.bilibili.com/player.html?aid={{ $videoID }}&page={{ $pageNum }}"
scrolling="no"
border="0"
frameborder="no"
framespacing="0"
allowfullscreen="true"
style="position:absolute; height: 100%; width: 100%;"
>
</iframe>
</div>
{{ end }} 演示链接点我 |
daymade
pushed a commit
to daymade/hugo-theme-even
that referenced
this issue
Sep 30, 2023
Closes olOwOlo#278 Co-authored-by: Herbert Lu <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: