共计 591 个字符,预计需要花费 2 分钟才能阅读完成。
1、打开网易云音乐首页,复制选择的背景音乐分享外链
2、引入播放器代码
在 themes/yilia/layout/_partial/left-col.ejs
文件 nav
标签中添加代码
注:放在
<nav>
和</nav>
之内
笔者添加了一些判断和表达式
123456 |
<!-- 网易云音乐插件 --><% if (theme.music && theme.music.enable){%> <div style="position:absolute; bottom:120px left:auto; width:85%"> <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width="240" height="52" src="https://music.163.com/outchain/player?type=2&id=<%=theme.music.id||1334445174%>&auto=<%=theme.music.autoplay?1:0%>&height=32"></iframe> </div><% } %>
|
3、在 yilia 主题配置文件中添加属性
12345 |
# 网易云音乐插件music: enable: true #id: 1332647902 # 网易云分享的 ID autoplay: true # 是否开启自动播放
|
正文完
星哥玩云-微信公众号
