Merge branch 'master' into master

This commit is contained in:
H 2020-06-07 10:11:04 +08:00 committed by GitHub
commit f6559e2da2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 87 additions and 122 deletions

View File

@ -1,88 +1,56 @@
<article id="<%= post.layout %>-<%= post.slug %>" class="article article-type-<%= post.layout %>" itemscope <section class="outer">
itemprop="blogPost" data-scroll-reveal> <article class="articles">
<%
<div class="article-inner"> var title = '';
<% if (post.link || post.title){ %> if (page.category) title = page.category;
<header class="article-header"> if (page.tag) title = "#" + "&nbsp" + page.tag;
<%- partial('post/title', {class_name: 'article-title'}) %> if (page.archive) {
</header> if (page.year) title = page.year + (page.month ? '/' + page.month : '');
<% } %> else title = __('archive_a');
}
<% if (index || is_post()) { %> %>
<div class="article-meta"> <% if (pagination !== 2){ %>
<%- partial('post/date', {class_name: 'article-date', date_format: null}) %> <h1 class="page-type-title"><%- title %></h1>
<%- 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="reward-btn">
<%= __('post.reward') %>
</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>
<%= __('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') %>
<% } %> <% } %>
<% if (pagination == 2){ %>
<% page.posts.each(function(post){ %>
<%- partial('article', {post: post, index: true}) %>
<% }) %>
</article> </article>
<% } else { %>
<% var last; %>
<% page.posts.each(function(post, i){ %>
<% var year = post.date.year(); %>
<% if (last != year){ %>
<% if (last != null){ %>
</div>
</div>
<% } %>
<% last = year; %>
<div class="archives-wrap">
<div class="archive-year-wrap">
<a href="<%- url_for(config.archive_dir + '/' + year) %>" class="archive-year"><%= year %></a>
</div>
<div class="archives">
<% } %>
<%- partial('archive-post', {post: post, even: i % 2 == 0}) %>
<% }) %>
<% if (page.posts.length){ %>
</div>
</div>
<% } %>
<% } %>
<% if (page.total > 1){ %>
<nav class="page-nav">
<%
var prev_text = theme.nav_text.page_prev;
var next_text = theme.nav_text.page_next
%>
<%- paginator({
prev_text: prev_text,
next_text: next_text
}) %>
</nav>
<% } %>
</section>

View File

@ -1,24 +1,21 @@
<% if (!index && theme.leancloud && theme.leancloud.enable){ %> <% if (!index && theme.leancloud && theme.leancloud.enable){ %>
<!-- valine评论 --> <!-- valine评论 -->
<div id="vcomments-box"> <div id="vcomments-box">
<div id="vcomments"> <div id="vcomments"></div>
</div>
</div> </div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script> <script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='https://cdn.jsdelivr.net/npm/valine@1.3.10/dist/Valine.min.js'></script> <script src="https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js"></script>
<script> <script>
new Valine({ new Valine({
el: '#vcomments', el: "#vcomments",
app_id: '<%- theme.leancloud.app_id %>', app_id: "<%- theme.leancloud.app_id %>",
app_key: '<%- theme.leancloud.app_key %>', app_key: "<%- theme.leancloud.app_key %>",
path: window.location.pathname, path: window.location.pathname,
notify: <%- theme.valine.notify %>, avatar: "<%- theme.valine.avatar %>",
verify: <%- theme.valine.verify %>, placeholder: "<%- theme.valine.placeholder %>",
avatar: '<%- theme.valine.avatar %>', recordIP: true,
placeholder: '<%- theme.valine.placeholder %>',
recordIP: true
}); });
const infoEle = document.querySelector('#vcomments .info'); const infoEle = document.querySelector("#vcomments .info");
if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) { if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
infoEle.childNodes.forEach(function (item) { infoEle.childNodes.forEach(function (item) {
item.parentNode.removeChild(item); item.parentNode.removeChild(item);