Skip to content

Commit

Permalink
支持二维码分享当前页面
Browse files Browse the repository at this point in the history
  • Loading branch information
xaoxuu committed Mar 3, 2020
1 parent bc74b84 commit 1f62475
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
4 changes: 0 additions & 4 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -253,15 +253,11 @@ meta:
- id: qzone
name: QQ空间
img: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-assets/logo/128/qzone.png
# - id: qrcode # 当id为qrcode时需要安装插件 npm i -S hexo-helper-qrcode
# name: 微信
# img: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-assets/logo/128/wechat.png
- id: weibo
name: 微博
img: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-assets/logo/128/weibo.png
# - id: qrcode # 当id为qrcode时需要安装插件 npm i -S hexo-helper-qrcode
# name: QRcode
# img: https://cdn.jsdelivr.net/gh/xaoxuu/cdn-assets/logo/128/qrcode.png
# 链接
btns:
edit:
Expand Down
13 changes: 6 additions & 7 deletions layout/_third-party/share.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
<div class="-mob-share-list share-body">
<% (theme.meta.share||[]).forEach(function(item){ %>
<% if (item.id == 'qrcode'){ %>
<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>
<% var src = qrcode(url,{margin:1,size:8}); %>
<fancybox>
<a class='qrcode' rel="external nofollow noopener noreferrer" data-fancybox="gallery-qrcode" href="<%- src %>">
<img style='height:16px;border-radius:0;margin-left:4px' src="<%- src %>">
</a>
</fancybox>
<% } else { %>
<a class="-mob-share-<%- item.id %>" title="<%- item.name %>" rel="external nofollow noopener noreferrer"
<% if (item.id == 'qzone'){ %>
Expand Down

0 comments on commit 1f62475

Please sign in to comment.