feat: Music
This commit is contained in:
parent
28d8716cf4
commit
836246b4e0
10
_config.yml
10
_config.yml
@ -27,6 +27,8 @@ logo: /images/ayer-side.svg
|
|||||||
|
|
||||||
# 封面配置
|
# 封面配置
|
||||||
# enable-是否启用封面;path-封面背景图;logo-封面logo
|
# enable-是否启用封面;path-封面背景图;logo-封面logo
|
||||||
|
|
||||||
|
|
||||||
cover:
|
cover:
|
||||||
enable: true
|
enable: true
|
||||||
path: /images/cover1.jpg # images目录下附送多张美图,可更换
|
path: /images/cover1.jpg # images目录下附送多张美图,可更换
|
||||||
@ -35,6 +37,14 @@ cover:
|
|||||||
# 页面顶部进度条
|
# 页面顶部进度条
|
||||||
progressBar: ture
|
progressBar: ture
|
||||||
|
|
||||||
|
# 网易云音乐插件
|
||||||
|
music:
|
||||||
|
enable: false
|
||||||
|
# 播放器尺寸类型(1:小尺寸、2:大尺寸)
|
||||||
|
type: 1
|
||||||
|
id: 518895142 # 网易云分享的音乐ID(更换音乐请更改此配置项)
|
||||||
|
autoPlay: true # 是否开启自动播放
|
||||||
|
|
||||||
# 文章配置
|
# 文章配置
|
||||||
# 文章太长,截断按钮文字(在需要截断的行增加此标记:<!--more-->)
|
# 文章太长,截断按钮文字(在需要截断的行增加此标记:<!--more-->)
|
||||||
excerpt_link: 阅读更多...
|
excerpt_link: 阅读更多...
|
||||||
|
16
layout/_partial/music.ejs
Normal file
16
layout/_partial/music.ejs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<div id="music">
|
||||||
|
<%# "bottom:120px; left:auto;position:fixed; width:85%" %>
|
||||||
|
<% var defaultHeight = theme.music.type == 1 ? '32' : '66'; %>
|
||||||
|
<% var defaultIframeHeight = theme.music.type == 1 ? '52' : '86'; %>
|
||||||
|
<iframe frameborder="no" border="1" marginwidth="0" marginheight="0" width="200" height="<%=defaultIframeHeight%>"
|
||||||
|
src="//music.163.com/outchain/player?type=2&id=<%=theme.music.id||518895142%>&auto=<%=theme.music.autoPlay?1:0%>&height=<%=defaultHeight%>"></iframe>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#music {
|
||||||
|
position: fixed;
|
||||||
|
right: 15px;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: 998;
|
||||||
|
}
|
||||||
|
</style>
|
@ -14,6 +14,10 @@
|
|||||||
</aside>
|
</aside>
|
||||||
<%- partial('_partial/modal') %>
|
<%- partial('_partial/modal') %>
|
||||||
<%- partial('_partial/after-footer') %>
|
<%- partial('_partial/after-footer') %>
|
||||||
|
|
||||||
|
<% if (theme.music&&theme.music.enable){ %>
|
||||||
|
<%- partial('_partial/music') %>
|
||||||
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user