i18n
xaoxuu 5 years ago
parent 6899124927
commit c744c69ae3
  1. 21
      _config.yml
  2. 6
      layout/_third-party/comments.ejs
  3. 2
      layout/_third-party/popular_posts.ejs
  4. 11
      layout/_third-party/recommended_posts.ejs

@ -26,13 +26,12 @@ services:
busuanzi: true
# fastclick: true
# leancloud_visitors: true
# recommended_posts: true # 需要安装插件 hexo-recommended-posts
popular_posts: true # 需要安装插件 hexo-related-popular-posts
# popular_posts: true # 需要安装插件 hexo-related-popular-posts
comments: true
volantis: true
music: true
share: true
qrcode: true # 需要安装插件 npm i -S hexo-helper-qrcode
# music: true
# share: true
# qrcode: true # 需要安装插件 npm i -S hexo-helper-qrcode
############################### 杂项 ###############################
@ -55,21 +54,9 @@ music:
post: true # layout: post 的页面是否显示
# 友链页头像占位图
loading_img: https://cdn.jsdelivr.net/gh/xaoxuu/volantis@1.0/img/qq/亲亲.gif
# 推荐文章
recommended_posts:
autoDisplay: false # 自动在文章底部显示推荐文章,如果你使用Material-X主题,这里要设置为false。
server: https://api.truelaurel.com # 后端推荐服务器地址
timeoutInMillis: 10000 # 服务时长,超过此时长,则使用离线推荐模式
excludePattern: []
titleHtml: <h4>推荐文章</h4> #自定义标题
internalLinks: 3 # 内部文章数量
externalLinks: 2 # 外部文章数量
fixedNumber: false
# Search
search:

@ -4,9 +4,6 @@
var displayPopularPosts = false;
var displayComments = false;
if (page && theme.services) {
if (theme.services.recommended_posts == true && theme.recommended_posts && theme.recommended_posts.autoDisplay == false && page.layout == 'post' && page.recommended_posts != false) {
displayRecommentedPosts = true;
}
if ((config.disqus_shortname || config.livere_uid || config.valine) && theme.services.comments == true && page.comments != false) {
displayComments = true;
}
@ -19,9 +16,6 @@
<% if (displayRecommentedPosts || displayPopularPosts || displayComments) { %>
<article class="post white-box comments">
<section class="article typo">
<% if (displayRecommentedPosts) { %>
<%- partial('recommended_posts', {page: page, site: site}) %>
<% } %>
<% if (displayPopularPosts) { %>
<%- partial('popular_posts', {page: page, site: site}) %>
<% } %>

@ -1,4 +1,4 @@
<div class="recommended_posts">
<div class="popular_posts">
<h4><i class="fas fa-bookmark fa-fw" aria-hidden="true"></i>&nbsp;<%- __('post.related_posts') %></h4>
<%- popular_posts( {} , post ) %>
</div>

@ -1,11 +0,0 @@
<% var post_list = recommended_posts(page, site) %>
<% if(post_list.length > 0) { %>
<div class="recommended_posts">
<h4><i class="fas fa-bookmark fa-fw" aria-hidden="true"></i>&nbsp;<%- __('post.related_posts') %></h4>
<ul>
<% post_list.forEach(function(link) { %>
<li><a href="<%= link.permalink %>"><%= link.title %></a></li>
<% }) %>
</ul>
</div>
<% } %>
Loading…
Cancel
Save