i18n 1.0.2
xaoxuu 6 years ago
parent eb69d9847f
commit 8a1c23ccb1
  1. 5
      _config.yml
  2. 2
      layout/_partial/article.ejs
  3. 26
      layout/_third-party/share.ejs

@ -26,11 +26,12 @@ services:
busuanzi: true
# fastclick: true
# leancloud_visitors: true
recommended_posts: true # 需要安装"hexo-recommended-posts": "^1.0.3",
recommended_posts: true # 需要安装插件 hexo-recommended-posts
comments: true
volantis: true
music: true
share: true
qrcode: true # 需要安装插件 npm i -S hexo-helper-qrcode
############################### 杂项 ###############################
@ -52,6 +53,8 @@ music:
links: true # layout: links 的页面是否显示
post: true # layout: post 的页面是否显示
# 友链页头像占位图
loading_img: https://cdn.jsdelivr.net/gh/xaoxuu/volantis@1.0/img/qq/亲亲.gif

@ -20,7 +20,7 @@
%>
<%- items.join(' ') %>
<% } %>
<% if (theme.services && theme.services.share == true && config.mob && config.mob.app_key && config.mob.list && (!page.meta || page.meta.share != false)) { %>
<% if (theme.services && theme.services.share == true && (config.share || config.mob) && (!page.meta || page.meta.share != false)) { %>
<%- partial('../_third-party/share') %>
<% } %>
</section>

@ -1,15 +1,33 @@
<% if (theme.services && theme.services.share == true && config.mob && config.mob.app_key && config.mob.list && page.layout == 'post' && page.share != false) { %>
<% if (theme.services && theme.services.share == true && (config.share || config.mob) && page.layout == 'post' && page.share != false) { %>
<div class='metatag share -mob-share-list'>
<i class="left fas fa-share-alt fa-fw" aria-hidden="true"></i>
<div class="-mob-share-list share-body">
<% (config.mob.list||[]).forEach(function(item){ %>
<a class="-mob-share-<%- item.id %>" title="<%- item.name %>">
<% ((config.share || config.mob.list)||[]).forEach(function(item){ %>
<% if (item.id == 'qrcode' && theme.services.qrcode == true){ %>
<a class='qrcode' rel="external nofollow noopener noreferrer" href='<%- qrcode(url) %>'>
<% if (item.img){ %>
<img src="<%- item.img %>">
<% } else if (item.icon){ %>
<i class="<%- item.icon %> fa-fw"></i>
<% } %>
</a>
</a>
<% } else { %>
<a class="-mob-share-<%- item.id %>" title="<%- item.name %>" rel="external nofollow noopener noreferrer"
<% if (item.id == 'qzone'){ %>
href="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=<%- post.permalink %>&title=<%- post.title + ' | ' + config.title %><%- (post.img || config.avatar) ? '&pics=' + (post.img || config.avatar) : '' %>&summary=<%- strip_html(post.excerpt) %>"
<% } else if (item.id == 'qq'){ %>
href="http://connect.qq.com/widget/shareqq/index.html?url=<%- post.permalink %>&title=<%- post.title + ' | ' + config.title %><%- (post.img || config.avatar) ? '&pics=' + (post.img || config.avatar) : '' %>&summary=<%- strip_html(post.excerpt) %>"
<% } else if (item.id == 'weibo'){ %>
href="http://service.weibo.com/share/share.php?url=<%- post.permalink %>&title=<%- post.title + ' | ' + config.title %><%- (post.img || config.avatar) ? '&pics=' + (post.img || config.avatar) : '' %>&summary=<%- strip_html(post.excerpt) %>"
<% } %>
>
<% if (item.img){ %>
<img src="<%- item.img %>">
<% } else if (item.icon){ %>
<i class="<%- item.icon %> fa-fw"></i>
<% } %>
</a>
<% } %>
<% }) %>
</div>
</div>

Loading…
Cancel
Save