You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.4 KiB
71 lines
2.4 KiB
<% if(is_home() || is_category() || is_archive() || is_tag() || page.layout == 'list') { |
|
var isPostList = true; |
|
} else { |
|
var isPostList = false; |
|
} |
|
var topMetas = (theme.meta && theme.meta.header) || []; |
|
if (isPostList) { |
|
topMetas = theme.layout.posts.meta || []; |
|
} else { |
|
topMetas = theme.layout.article.header || []; |
|
} |
|
if (post.meta && (post.meta.header !== undefined && post.meta.header !== null)) { |
|
if (post.meta.header.length) { |
|
topMetas = post.meta.header; |
|
} else { |
|
topMetas = []; |
|
} |
|
} |
|
var bottomMetas = (theme.meta && theme.meta.footer) || []; |
|
if (isPostList) { |
|
bottomMetas = []; |
|
} else { |
|
bottomMetas = theme.layout.article.footer || []; |
|
} |
|
if (post.meta && (post.meta.footer !== undefined && post.meta.footer !== null)) { |
|
if (post.meta.footer.length) { |
|
bottomMetas = post.meta.footer; |
|
} else { |
|
bottomMetas = []; |
|
} |
|
} |
|
%> |
|
|
|
<% if (position == 'header') { %> |
|
<section class='meta'> |
|
<% if (post.music && post.music.enable != false) { %> |
|
<%- partial('../_third-party/aplayer', |
|
{aplayer_theme: '', aplayer_mini: true, aplayer_mode: 'circulation', |
|
aplayer_server: post.music.server, aplayer_type: post.music.type, aplayer_id: post.music.id, |
|
aplayer_volume: post.music.volume?post.music.volume:'0.7', aplayer_autoplay: post.music.autoplay?true:false }) %> |
|
<% } %> |
|
<% if(post.thumbnail && post.thumbnail.length){ %> |
|
<a title='<%- post.title %>' href='<%- url_for(post.link || post.path) %>'><img class='thumbnail' src='<%- post.thumbnail %>'></a> |
|
<% } %> |
|
<div class="meta" id="header-meta"> |
|
<% if((topMetas).indexOf('title') > -1){ %> |
|
<%- partial('../_meta/' + 'title', {post: post, isPostList: isPostList}) %> |
|
<% } %> |
|
<div class='new-meta-box'> |
|
<% (topMetas).forEach(function(meta){ %> |
|
<% if(meta != 'title'){ %> |
|
<%- partial('../_meta/' + meta, {post: post, isPostList: isPostList}) %> |
|
<% } %> |
|
<% }) %> |
|
</div> |
|
<% if ((topMetas).length > 0){ %> |
|
<hr> |
|
<% } %> |
|
</div> |
|
</section> |
|
<% } else if (position == 'footer') { %> |
|
<section class='meta' id="footer-meta"> |
|
<div class='new-meta-box'> |
|
<% (bottomMetas).forEach(function(meta){ %> |
|
<% if(meta != 'title'){ %> |
|
<%- partial('../_meta/' + meta, {post: post, isPostList: isPostList}) %> |
|
<% } %> |
|
<% }) %> |
|
</div> |
|
</section> |
|
<% } %>
|
|
|