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.
63 lines
2.4 KiB
63 lines
2.4 KiB
<% var sections = page.body ? page.body : theme.layout.on_page.body; %> |
|
<% sections.forEach(function(widget_id){ %> |
|
<% if (widget_id == 'article') { %> |
|
<article id="<%= post.layout %>" class="post white-box <%- theme.style.body.effect.join(' ') %> article-type-<%= post.layout %>" itemscope itemprop="blogPost"> |
|
<%- partial('meta', {post: post, position: 'header'}) %> |
|
<section class="article typo"> |
|
<div class="article-entry" itemprop="articleBody"> |
|
<% (post.photos||[]).forEach(function(photo){ %> |
|
<div class='fancybox'><img src='<%- url_for(photo) %>'/></div> |
|
<% }) %> |
|
<%- post.content %> |
|
<% if(theme.layout.on_post.article_footer && (page.layout == 'post')){ %> |
|
<br> |
|
<%- partial('../_widget/load', {widgets: theme.layout.on_post.article_footer, where: 'article'}) %> |
|
<% } %> |
|
</div> |
|
<% if(post.layout == 'post' || post.layout == 'page'){ %> |
|
<%- partial('meta', {post: post, position: 'footer'}) %> |
|
<% } %> |
|
<% if(post.prev || post.next){ %> |
|
<div class="prev-next"> |
|
<% if(post.prev){ %> |
|
<a class='prev' href='<%- url_for(post.prev.path) %>'> |
|
<p class='title'><i class="fas fa-chevron-left" aria-hidden="true"></i><%- post.prev.title || '' %></p> |
|
<p class='content'><%- truncate(strip_html(page.prev.content), {length: 100}) %></p> |
|
</a> |
|
<% } %> |
|
<% if(post.next){ %> |
|
<a class='next' href='<%- url_for(post.next.path) %>'> |
|
<p class='title'><%- post.next.title || '' %><i class="fas fa-chevron-right" aria-hidden="true"></i></p> |
|
<p class='content'><%- truncate(strip_html(page.next.content), {length: 100}) %></p> |
|
</a> |
|
<%} %> |
|
</div> |
|
<%} %> |
|
</section> |
|
</article> |
|
<% } else if (widget_id == 'comments') { %> |
|
<%- partial('../_third-party/comments') %> |
|
<% } else { %> |
|
<%- partial('../_widget/load', {widgets: [widget_id], where: 'body'}) %> |
|
<% } %> |
|
<% }) %> |
|
|
|
<% |
|
if (sections.indexOf('comments') < 0) { |
|
page.comments = false; |
|
} |
|
%> |
|
|
|
<!-- 根据页面mathjax变量决定是否加载MathJax数学公式js --> |
|
<% if (page.mathjax){ %> |
|
<%- partial('../_third-party/mathjax') %> |
|
<% } %> |
|
|
|
<% if (page.layout == 'post'){ %> |
|
<script> |
|
window.subData = { |
|
title: '<%- post.title %>', |
|
tools: true |
|
} |
|
</script> |
|
<% } %>
|
|
|