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.
68 lines
2.1 KiB
68 lines
2.1 KiB
<% if(is_home() || is_category() || is_archive() || is_tag() || page.layout == 'list') { |
|
var isPostList = true; |
|
} else { |
|
var isPostList = false; |
|
} |
|
var topMetas; |
|
if (isPostList) { |
|
topMetas = theme.layout.on_list.meta || []; |
|
} else { |
|
topMetas = theme.layout.on_page.meta.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; |
|
if (isPostList) { |
|
bottomMetas = []; |
|
} else { |
|
bottomMetas = theme.layout.on_page.meta.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', {post: post, where: 'meta'}) %> |
|
<% } %> |
|
<% 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') && (meta in theme.meta)){ %> |
|
<%- 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') && (meta in theme.meta)){ %> |
|
<%- partial('../_meta/' + meta, {post: post, isPostList: isPostList}) %> |
|
<% } %> |
|
<% }) %> |
|
</div> |
|
</section> |
|
<% } %>
|
|
|