diff --git a/_config.yml b/_config.yml index 7c3f444..ea1cfa1 100755 --- a/_config.yml +++ b/_config.yml @@ -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 diff --git a/layout/_partial/article.ejs b/layout/_partial/article.ejs index 85ae362..5072f9c 100755 --- a/layout/_partial/article.ejs +++ b/layout/_partial/article.ejs @@ -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') %> <% } %> diff --git a/layout/_third-party/share.ejs b/layout/_third-party/share.ejs index 1d597d8..71c6730 100644 --- a/layout/_third-party/share.ejs +++ b/layout/_third-party/share.ejs @@ -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) { %>
- <% (config.mob.list||[]).forEach(function(item){ %> - + <% ((config.share || config.mob.list)||[]).forEach(function(item){ %> + <% if (item.id == 'qrcode' && theme.services.qrcode == true){ %> + <% if (item.img){ %> <% } else if (item.icon){ %> <% } %> - + + <% } else { %> + + 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){ %> + + <% } else if (item.icon){ %> + + <% } %> + + <% } %> <% }) %>