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.

111 lines
4.8 KiB

5 years ago
<% var sections = page.body ? page.body : theme.layout.article.body; %>
4 years ago
<% sections.forEach(function(widget_id){ %>
<% if (widget_id == 'article') { %>
<article id="<%= post.layout %>" class="post white-box article-type-<%= post.layout %>" itemscope itemprop="blogPost">
<%- partial('meta', {post: post, position: 'header'}) %>
<section class="article typo">
<div class="article-entry" itemprop="articleBody">
4 years ago
<% (post.photos||[]).forEach(function(photo){ %>
4 years ago
<fancybox><img src='<%- url_for(photo) %>'/></fancybox>
<% }) %>
4 years ago
<%- post.content %>
4 years ago
<% if(theme.footer_post && page.layout == 'post'){ %>
4 years ago
<br>
<%- markdown(theme.footer_post) %>
<% } %>
</div>
<% if(post.layout == 'post'){ %>
<br>
<%- partial('meta', {post: post, position: 'footer'}) %>
5 years ago
<% } %>
4 years ago
<% if(post.prev || post.next){ %>
<div class="prev-next">
<% if(post.prev){ %>
<section class="prev">
<span class="art-item-left">
<h6><i class="fas fa-chevron-left" aria-hidden="true"></i>&nbsp;<%- __('post.prev_page') %></h6>
<h4>
<a href="<%=url_for(post.prev.path)%>" rel="prev" title="<%=post.prev.title%>">
<% if(post.prev.title){ %>
<%= post.prev.title %>
<% } else if (post.prev.date) { %>
<%= date(post.prev.date, config.date_format) %>
<% } %>
</a>
</h4>
<% if (post.prev.tags && post.prev.tags.length && post.prev.tags.each) { %>
<%
var items = [];
post.prev.tags.each(function(item){
items.push('<a class="tag" href="'+url_for(item.path)+'"><i class="fas fa-tag fa-fw" aria-hidden="true"></i> ' + item.name + '</a>');
});
%>
<h6 class="tags">
<%- items.join(' ') %>
</h6>
<% } %>
</span>
</section>
<% } %>
<% if(post.next){ %>
<section class="next">
<span class="art-item-right" aria-hidden="true">
<h6><%- __('post.next_page') %>&nbsp;<i class="fas fa-chevron-right" aria-hidden="true"></i></h6>
<h4>
<a href="<%=url_for(post.next.path)%>" rel="prev" title="<%=post.next.title%>">
<% if(post.next.title){ %>
<%= post.next.title %>
<% } else if (post.next.date) { %>
<%= date(post.next.date, config.date_format) %>
<% } %>
</a>
</h4>
<% if (post.next.tags && post.next.tags.length && post.next.tags.each) { %>
<%
var items = [];
post.next.tags.each(function(item){
items.push('<a class="tag" href="'+url_for(item.path)+'"><i class="fas fa-tag fa-fw" aria-hidden="true"></i> ' + item.name + '</a>');
});
%>
<h6 class="tags">
<%- items.join(' ') %>
</h6>
<% } %>
</span>
</section>
<%} %>
</div>
<%} %>
</section>
</article>
<% } else if (widget_id == 'comments') { %>
<%- partial('../_third-party/comments') %>
<% } else { %>
<% theme.widget.forEach(function(widget){ %>
<% if (widget.id == widget_id){ %>
<%- partial('../_widget/' + widget.class, {item: widget}) %>
<% } %>
<% }) %>
<% } %>
<% }) %>
7 years ago
5 years ago
<%
if (sections.indexOf('comments') < 0) {
page.comments = false;
}
%>
<!-- 根据页面mathjax变量决定是否加载MathJax数学公式js -->
<% if (page.mathjax){ %>
5 years ago
<%- partial('mathjax') %>
<% } %>
5 years ago
<% if (page.layout == 'post'){ %>
<script>
6 years ago
window.subData = {
5 years ago
title: '<%- post.title %>',
tools: true
6 years ago
}
5 years ago
</script>
<% } %>