Hexo插入音樂/視頻/網易云音樂/bilibili視頻,會讓博客看起來很洋氣 (? ??_??)? 。查看更多于本人博客:iii.run
Markdown 通用的音樂視頻插入方法
iframe 標簽
代碼從網易云音樂獲得
網易云音樂
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=430 height=86 src="http://music.163.com/outchain/player?type=2&id=114389&auto=0&height=66"></iframe>
因為簡書不支持,可以在李飛陽看到效果。
iframe
embed 標簽
<embed height="415" width="544" quality="high" allowfullscreen="true" type="application/x-shockwave-flash" src="http://static.hdslb.com/miniloader.swf" flashvars="aid=8506694&page=1" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"></embed>
因為簡書不支持,可以在李飛陽看到效果。
embed
javascript 標簽舉例
<script type="text/javascript" src="http://www.xiami.com/widget/player-single?uid=32329501&sid=1776238762&mode=js"></script>
javascript
使用 Hexo 插件插入音樂/視頻
兩個好用的hexo插件:
**hexo-tag-aplayer:https://github.com/grzhan/hexo-tag-aplayer)
**hexo-tag-dplayer: https://github.com/NextMoe/hexo-tag-dplayer
播放音樂的aplayer
在cmd頁面內,使用npm安裝:
npm install hexo-tag-aplayer
在markdown內添加以下代碼:
{% aplayer "她的睫毛" "周杰倫" "http://home.ustc.edu.cn/~mmmwhy/%d6%dc%bd%dc%c2%d7%20-%20%cb%fd%b5%c4%bd%de%c3%ab.mp3" "http://home.ustc.edu.cn/~mmmwhy/jay.jpg" "autoplay=false" %}
aplayer
播放視頻的dplayer
在cmd頁面內,使用npm安裝:
npm install hexo-tag-dplayer
在markdown內添加以下代碼:
{% dplayer "url=http://home.ustc.edu.cn/~mmmwhy/GEM.mp4" "pic=http://home.ustc.edu.cn/~mmmwhy/GEM.jpg" "loop=yes" "theme=#FADFA3" "autoplay=false" "token=tokendemo" %}
dplayer
以上