Merge branch 'master' into master
This commit is contained in:
commit
f6559e2da2
@ -1,88 +1,56 @@
|
||||
<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>
|
||||
<section class="outer">
|
||||
<article class="articles">
|
||||
<%
|
||||
var title = '';
|
||||
if (page.category) title = page.category;
|
||||
if (page.tag) title = "#" + " " + page.tag;
|
||||
if (page.archive) {
|
||||
if (page.year) title = page.year + (page.month ? '/' + page.month : '');
|
||||
else title = __('archive_a');
|
||||
}
|
||||
%>
|
||||
<% if (pagination !== 2){ %>
|
||||
<h1 class="page-type-title"><%- title %></h1>
|
||||
<% } %>
|
||||
|
||||
<% 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="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>
|
||||
|
||||
<% if (pagination == 2){ %>
|
||||
<% page.posts.each(function(post){ %>
|
||||
<%- partial('article', {post: post, index: true}) %>
|
||||
<% }) %>
|
||||
</article>
|
||||
<% } else { %>
|
||||
<% var last; %>
|
||||
<% page.posts.each(function(post, i){ %>
|
||||
<% var year = post.date.year(); %>
|
||||
<% if (last != year){ %>
|
||||
<% if (last != null){ %>
|
||||
</div>
|
||||
|
||||
<% if (!index){ %>
|
||||
<%- partial('post/nav') %>
|
||||
</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 (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 (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>
|
||||
<% } %>
|
||||
|
||||
<% if (is_post()) { %>
|
||||
<%- partial('post/gitalk') %>
|
||||
<% } %>
|
||||
|
||||
<% if (theme.minivaline && theme.minivaline.enable && !post.no_minivaline) { %>
|
||||
<%- partial('post/minivaline') %>
|
||||
<% } %>
|
||||
</article>
|
||||
</section>
|
@ -7,9 +7,9 @@
|
||||
<script src='https://unpkg.com/minivaline/dist/MiniValine.min.js'></script>
|
||||
<script>
|
||||
new MiniValine({
|
||||
el: '#vcomments',
|
||||
appId: '<%- theme.leancloud.app_id %>',
|
||||
appKey: '<%- theme.leancloud.app_key %>',
|
||||
el: '#vcomments',
|
||||
appId: '<%- theme.leancloud.app_id %>',
|
||||
appKey: '<%- theme.leancloud.app_key %>',
|
||||
mode: '<%- theme.minivaline.mode %>',
|
||||
placeholder: '<%- theme.minivaline.placeholder %>',
|
||||
pathname: window.location.pathname,
|
||||
|
@ -1,51 +1,48 @@
|
||||
<% if (!index && theme.leancloud && theme.leancloud.enable){ %>
|
||||
<!-- valine评论 -->
|
||||
<div id="vcomments-box">
|
||||
<div id="vcomments">
|
||||
</div>
|
||||
<div id="vcomments"></div>
|
||||
</div>
|
||||
<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>
|
||||
new Valine({
|
||||
el: '#vcomments',
|
||||
app_id: '<%- theme.leancloud.app_id %>',
|
||||
app_key: '<%- theme.leancloud.app_key %>',
|
||||
path: window.location.pathname,
|
||||
notify: <%- theme.valine.notify %>,
|
||||
verify: <%- theme.valine.verify %>,
|
||||
avatar: '<%- theme.valine.avatar %>',
|
||||
placeholder: '<%- theme.valine.placeholder %>',
|
||||
recordIP: true
|
||||
new Valine({
|
||||
el: "#vcomments",
|
||||
app_id: "<%- theme.leancloud.app_id %>",
|
||||
app_key: "<%- theme.leancloud.app_key %>",
|
||||
path: window.location.pathname,
|
||||
avatar: "<%- theme.valine.avatar %>",
|
||||
placeholder: "<%- theme.valine.placeholder %>",
|
||||
recordIP: true,
|
||||
});
|
||||
const infoEle = document.querySelector("#vcomments .info");
|
||||
if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
|
||||
infoEle.childNodes.forEach(function (item) {
|
||||
item.parentNode.removeChild(item);
|
||||
});
|
||||
const infoEle = document.querySelector('#vcomments .info');
|
||||
if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
|
||||
infoEle.childNodes.forEach(function (item) {
|
||||
item.parentNode.removeChild(item);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
#vcomments-box {
|
||||
padding: 5px 30px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 800px) {
|
||||
#vcomments-box {
|
||||
padding: 5px 30px;
|
||||
padding: 5px 0px;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 800px) {
|
||||
#vcomments-box {
|
||||
padding: 5px 0px;
|
||||
}
|
||||
}
|
||||
#vcomments-box #vcomments {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
#vcomments-box #vcomments {
|
||||
background-color: #fff;
|
||||
}
|
||||
.v .vlist .vcard .vh {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.v .vlist .vcard .vh {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.v .vlist .vcard {
|
||||
padding-left: 10px;
|
||||
}
|
||||
.v .vlist .vcard {
|
||||
padding-left: 10px;
|
||||
}
|
||||
</style>
|
||||
<% } %>
|
||||
<% } %>
|
||||
|
Loading…
Reference in New Issue
Block a user