hexo-theme-ayer/layout/_partial/article.ejs
边宇琨 736a5d3876
实现版权声明内容自定义。
通过 Front-matter 实现针对特定文章的版权声明内容自定义。  
例如:  
copyright_content: 本文章遵守 CC BY-SA 4.0 协议。
2020-09-10 02:22:51 +08:00

72 lines
2.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<article
id="<%= post.layout %>-<%= post.slug %>"
class="article article-type-<%= post.layout %>"
itemscope
itemprop="blogPost"
data-scroll-reveal
>
<div class="article-inner">
<% if (post.link || post.title){ %>
<header class="article-header">
<%- partial('post/title', {class_name: 'article-title'}) %>
</header>
<% } %> <% if (index || is_post()) { %>
<div class="article-meta">
<%- partial('post/date', {class_name: 'article-date', date_format: null})
%> <%- partial('post/category') %> <% if(theme.word_count &&
theme.word_count.enable && !post.no_word_count){%> <%-
partial('post/word') %> <% } %>
</div>
<% } %> <% if (theme.toc && is_post()){ %> <%- partial('post/tocbot') %> <%
} %> <% if (theme.excerpt_all&&index){ %> <% }else{ %>
<div class="article-entry" itemprop="articleBody">
<%- partial('post/justifiedGallery') %> <%- partial('post/gallery') %> <%
if (post.excerpt && index){ %> <%- post.excerpt %> <% if
(theme.excerpt_link){ %>
<a class="article-more-link" href="<%- url_for(post.path) %>"
><%= theme.excerpt_link %></a
>
<% } %> <% } else { %> <%- post.content %> <% } %>
<!-- reward -->
<% if ((theme.reward_type === 2 || (theme.reward_type === 1 &&
post.reward)) && !index && !post.no_reward){ %>
<div id="reword-out">
<div id="reward-btn">
<%= __('post.reward') %>
</div>
</div>
<% } %>
</div>
<% } %>
<!-- copyright -->
<% if (((theme.copyright_type === 2) || (theme.copyright_type === 1 &&
post.copyright)) && !index){ %>
<div class="declare">
<ul class="post-copyright">
<li>
<i class="ri-copyright-line"></i>
<strong><%= __('post.copyright_title') %> </strong>
<% if (post.copyright_content) { %>
<%= post.copyright_content %>
<% } else { %>
<%= __('post.copyright_content') %>
<% } %>
</li>
</ul>
</div>
<% } %>
<footer class="article-footer">
<% if (!index && theme.share_enable){ %> <%- partial('post/share') %> <% }
%> <%- partial('post/tag') %>
</footer>
</div>
<% if (!index){ %> <%- partial('post/nav') %> <% } %> <% if (theme.valine &&
theme.valine.enable && !post.no_valine){ %> <%- partial('post/valine', { key:
post.slug, title: post.title, url: config.url+url_for(post.path) }) %> <% } %>
<% if (is_post()) { %> <%- partial('post/gitalk') %> <% } %> <% if
(theme.minivaline && theme.minivaline.enable && !post.no_minivaline){ %> <%-
partial('post/minivaline') %> <% } %>
</article>