|
|
|
@ -1,3 +1,44 @@ |
|
|
|
|
<% |
|
|
|
|
var needDisplay = false; |
|
|
|
|
if (theme.widgets.music && theme.widgets.music.display) { |
|
|
|
|
let display = theme.widgets.music.display; |
|
|
|
|
if (page.layout == 'page') { |
|
|
|
|
if (display.page != false) { |
|
|
|
|
needDisplay = true; |
|
|
|
|
} |
|
|
|
|
} else if (page.layout == 'post') { |
|
|
|
|
if (display.post != false && (!page.music || page.music.enable == false)) { |
|
|
|
|
needDisplay = true; |
|
|
|
|
} |
|
|
|
|
} else if (page.layout == 'links') { |
|
|
|
|
if (display.links != false) { |
|
|
|
|
needDisplay = true; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (is_home()) { |
|
|
|
|
if (display.home != false) { |
|
|
|
|
needDisplay = true; |
|
|
|
|
} |
|
|
|
|
} else if (is_tag()) { |
|
|
|
|
if (display.tag != false) { |
|
|
|
|
needDisplay = true; |
|
|
|
|
} |
|
|
|
|
} else if (is_category()) { |
|
|
|
|
if (display.category != false) { |
|
|
|
|
needDisplay = true; |
|
|
|
|
} |
|
|
|
|
} else if (is_archive()) { |
|
|
|
|
if (display.archive != false) { |
|
|
|
|
needDisplay = true; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
needDisplay = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
%> |
|
|
|
|
|
|
|
|
|
<% if (needDisplay == true) { %> |
|
|
|
|
<section class='m_widget' id='music'> |
|
|
|
|
<header class='header <%= theme.style %>'> |
|
|
|
|
<div><i class="<%= theme.widgets.music.icon %> fa-fw" aria-hidden="true"></i> <%= theme.widgets.music.title %></div> |
|
|
|
@ -12,3 +53,7 @@ |
|
|
|
|
data-volume="<%= theme.widgets.music.volume %>"></div> |
|
|
|
|
</div> |
|
|
|
|
</section> |
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.css"> |
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/aplayer@1.7.0/dist/APlayer.min.js"></script> |
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/meting@1.1.0/dist/Meting.min.js"></script> |
|
|
|
|
<% } %> |
|
|
|
|