Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add share icon #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 23 additions & 21 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ favicon: /favicon.png
## If your site' url is 'http://yoursite.com/blog', set root_url as '/blog/'
## 网站若存放在子目录,请按上面格式填写
## https://hexo.io/docs/configuration.html#URL
root_url:
root_url:

# Year of Site Creation | 网站成立年份
since: 2016
Expand Down Expand Up @@ -89,23 +89,23 @@ show_count: false
## 是否在主页文章标题旁显示评论数(多说、Disqus)
## Add comment count after article title

disqus:
disqus:
#on: true
shortname:
shortname:
# https://help.disqus.com/customer/en/portal/articles/466208-what-s-a-shortname-
# It is unnecessary to enable disqus here if
# you have set "disqus_shortname" in your site's "_config.yml"
# It is unnecessary to enable disqus here if
# you have set "disqus_shortname" in your site's "_config.yml"

duoshuo:
duoshuo:
#on: true
domain:
domain:
# 是否开启多说评论,http://duoshuo.com/create-site/
# 使用上面网址登陆你的多说,然后创建站点,在 domain 中填入你设定的域名前半部分
# http://<要填的部分>.duoshuo.com (domain只填上<>里的内容,不要填整个网址)

youyan:
#on: true
id:
id:
# 是否开启友言评论,http://www.uyan.cc/index.php
# id 中填写你的友言用户数字ID,注册后进入后台管理即可查看
# 友言服务在 Web 环境下运行,普通本地环境无法查看,请部署后在线上测试。
Expand All @@ -122,14 +122,14 @@ background_image: 5
# Base Font Size | 字号调节
base_font_size: 16 #px, 16 - 24

## General Color Scheme | 主题配色方案
## General Color Scheme | 主题配色方案
## 可用值 Value: yilia
color_scheme:
color_scheme:

highlight_style:
#on: true
inline_code: 1 # Value: 0 - 9 可选
code_block: 1 # Value: 0 - 4
code_block: 1 # Value: 0 - 4
# Set inline_code to style highlight text
# Chose a highlight theme for code block
# 通过 inline_code 切换内置文本高亮样式
Expand Down Expand Up @@ -168,8 +168,8 @@ animate: true
# 工具提示框样式美化
jquery_ui: false

# Max width of right cloumn | 限制右侧内容的宽带
limit_article_width:
# Max width of right cloumn | 限制右侧内容的宽带
limit_article_width:
on: false
max_width: 60 # em

Expand Down Expand Up @@ -218,7 +218,7 @@ ie_updater:
## http://outdatedbrowser.com/

# Tab Title Change | 标签页标题切换
tab_title_change:
tab_title_change:
on: false
left_tab_title: '(つェ⊂) 我藏好了哦~ '
return_tab_title: '(*´∇`*) 被你发现啦~ '
Expand All @@ -229,7 +229,7 @@ tab_title_change:
# Local Site Search | 本地站内搜索
## Insatall below plugin to take effect | 使用搜索需先安装对应插件
## https://github.com/PaicHyperionDev/hexo-generator-search
search:
search:
#on: true
onload: false
## true: get search.xml file when the page has loaded
Expand All @@ -244,8 +244,10 @@ fancybox: true
mathjax: false

# Socail Share | 是否开启分享
share:
share:
on: true
## Shared icon | 分享图标 300x300
sharedIcon: /img/sharing.jpg
baidu: true
addthis: false
addthis_pubid: "ra-56ff76c972fc0cf9"
Expand All @@ -254,15 +256,15 @@ share:

# 百度、谷歌站长验证。填写 HTML 标签 content
# Site Verification for Google and Baidu. HTML label content.
baidu_site:
google_site:
baidu_site:
google_site:

# Fill in Google Analytics tracking ID, #e.g. UA-XXXXX-X
google_analytics:
google_analytics:

# 百度统计 http://sitecenter.baidu.com/sc-web/
# 查看代码,填入 //hm.baidu.com/hm.js? 之后的内容
baidu_tongji:
baidu_tongji:

# 不蒜子网站计数设置
# http://ibruce.info/2015/04/04/busuanzi/
Expand Down Expand Up @@ -298,4 +300,4 @@ CDN:
pace_js: //cdn.bootcss.com/pace/1.0.2/pace.min.js
clipboard: //cdn.bootcss.com/clipboard.js/1.5.10/clipboard.min.js
mathjax: //cdn.bootcss.com/mathjax/2.6.1/MathJax.js
scrollreveal: //cdn.bootcss.com/scrollReveal.js/3.1.4/scrollreveal.min.js
scrollreveal: //cdn.bootcss.com/scrollReveal.js/3.1.4/scrollreveal.min.js
5 changes: 1 addition & 4 deletions layout/_partial/post/share.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,11 @@
</div>
<script>
window._bd_share_config={
"common":{"bdSnsKey":{},"bdText":"<%- post.title %> | <%- config.title %> ","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
"common":{"bdSnsKey":{},"bdText":"<%- post.title %> | <%- config.title %> ","bdMini":"2","bdMiniList":false,"bdPic":"<%- theme.url %><%- theme.share.sharedIcon %>","bdStyle":"0","bdSize":"24"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];
</script>
<% } %>

<% if (theme.share.addthis) { %>
<div class="addthis_sharing_toolbox"></div>
<% } %>
</div>



3 changes: 2 additions & 1 deletion layout/layout.ejs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<%- partial('_partial/head') %>
<body>
<div style="display: none"><img src="<%- theme.share.sharedIcon %>" /></div>
<div id="container">
<div class="left-col">
<%- partial('_partial/left-col', null, {cache: !config.relative_link}) %>
Expand All @@ -12,4 +13,4 @@
<%- partial('_partial/after-footer') %>
</div>
</body>
</html>
</html>
Binary file added source/img/sharing.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.