halo文章中链接网易云音乐、Bilibili

halo文章中链接网易云音乐、Bilibili

from官方文档:https://halo.run/archives/use-markdown.html

网易云音乐:

# markdown中写:
[music:id]
# 比如id=30251507,会被解析成:
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=30251507&auto=1&height=66"></iframe>

效果如下:

Bilibili:

# markdown中写:
[bilibili:aid,width,height]
# 比如:aid=71119396,width=480,height=360,会被解析成:
<iframe height=360 width=480 src="//player.bilibili.com/player.html?aid=71119396" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>

效果如下:


因为b站站外只能播360p的,所以大小我也只能填成360p对应大小了=。=

直接用iframe的方式

Sanarous的博客发现了更好的方法,可以自动适配大小,同时也可以更精细的调节

<div style="position: relative; padding: 30% 45%;">
<iframe style="position: absolute; width: 100%; height: 100%; left: 0; top: 0;" src="//player.bilibili.com/player.html?aid=71119396&page=1&as_wide=1&high_quality=1&danmaku=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
</div>

效果如下