Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbbe5716

Browse files
committed
added Valine comment plugin and a few other features
1 parent3160d9f commitbbe5716

File tree

12 files changed

+407
-87
lines changed

12 files changed

+407
-87
lines changed

‎CHANGELOG.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#Changelog
2+
3+
##🚀 1.1.0 (Oct 12, 2019)
4+
5+
Added a few more features and enhanced a bit here and there. Have fun and enjoy blogging! ❤️
6+
7+
###Features ✨
8+
- Added[Valine](https://valine.js.org) comment plugin support.
9+
- Article page enhanced TOC style and feature.
10+
- Article page added user profile box.
11+
- Added Article view count.
12+
13+
###Changes 🙌
14+
- Article page changed to grid layout.
15+
- Article page changed to two column layout, now with sidebar.
16+
17+
##🚀 1.0.0 (Oct 10, 2019)
18+
####Features ✨
19+
- Very first complete version of the theme

‎README.md‎

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
>A dark Hexo theme, it's responsive, simple but elegant.
33
44
**[PREVIEW](http://tridiamond.tech)** |
5-
**[中文文档](https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/README_CN.md)**
5+
**[中文文档](https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/README_CN.md)** |
6+
**[CHANGES](https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/CHANGELOG.md)**
7+
68

79
![screenshot](https://s2.ax1x.com/2019/10/01/uNBcND.png)
810

@@ -53,14 +55,17 @@ menu:
5355
PAGE:/page
5456

5557
# Enable table of content
56-
TOC:false
58+
TOC:true
5759

5860
# Home page first post default cover image, default use cover
5961
welcome_cover:/img/cover.jpg
6062

6163
# Article default cover image
6264
cover:/img/welcome-cover.jpg
6365

66+
# Avatar
67+
avatar:https://s2.ax1x.com/2019/09/19/nLtSiD.png
68+
6469
# Disable default scrollbar
6570
scrollbar:true
6671

@@ -98,6 +103,7 @@ mp3:
98103
# Gitalk comment plugin
99104
# see https://github.com/gitalk/gitalk
100105
gitalk:
106+
enable:false
101107
autoExpand:false
102108
clientID:''
103109
clientSecret:''
@@ -108,6 +114,18 @@ gitalk:
108114
id:location.pathname
109115
# Facebook-like distraction
110116

117+
# Valine comment plugin (recommended!)
118+
# see https://valine.js.org/quickstart.html
119+
valine:
120+
enable:true
121+
app_id:
122+
app_key:
123+
notify:false
124+
verify:false
125+
avatar:'mp'
126+
placeholder:'Leave your throughs behind~'
127+
visitor:true
128+
111129
# Enable symbols-count-time plugin
112130
# see https://github.com/theme-next/hexo-symbols-count-time
113131
symbols_count_time:

‎README_CN.md‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
>一款暗色的Hexo主题, 拥有响应式布局, 简约而优雅.
33
44
**[预览](http://tridiamond.tech)** |
5-
**[English Doc](https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/README.md)**
5+
**[English Doc](https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/README.md)** |
6+
**[更新日志](https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/CHANGELOG.md)**
67

78
![screenshot](https://s2.ax1x.com/2019/10/01/uNBcND.png)
89

@@ -51,14 +52,17 @@ menu:
5152
PAGE:/page
5253

5354
# 是否启用目录
54-
TOC:false
55+
TOC:true
5556

5657
# 首页封面使用的封面图, 不配置默认使用cover配置的图片
5758
welcome_cover:/img/cover.jpg
5859

5960
# 文章默认封面图
6061
cover:/img/welcome-cover.jpg
6162

63+
# 文章内的默认头像
64+
avatar:https://s2.ax1x.com/2019/09/19/nLtSiD.png
65+
6266
# 关闭默认滚动条
6367
scrollbar:true
6468

@@ -106,6 +110,18 @@ gitalk:
106110
id:location.pathname
107111
# Facebook-like distraction
108112

113+
# Valine 评论插件 (推荐使用!)
114+
# 查看 https://valine.js.org/quickstart.html
115+
valine:
116+
enable:true
117+
app_id:
118+
app_key:
119+
notify:false
120+
verify:false
121+
avatar:'mp'
122+
placeholder:'Leave your throughs behind~'
123+
visitor:true
124+
109125
# 文章字数和阅读时间统计插件
110126
# see https://github.com/theme-next/hexo-symbols-count-time
111127
symbols_count_time:

‎_config.yml‎

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@ menu:
2121
PAGE:/page
2222

2323
# Enable table of content
24-
TOC:false
24+
TOC:true
2525

2626
# Home page first post default cover image, default use cover
2727
welcome_cover:/img/cover.jpg
2828

2929
# Article default cover image
3030
cover:/img/welcome-cover.jpg
3131

32+
# Avatar
33+
avatar:https://s2.ax1x.com/2019/09/19/nLtSiD.png
34+
3235
# Disable default scrollbar
3336
scrollbar:true
3437

@@ -66,6 +69,7 @@ mp3:
6669
# Gitalk comment plugin
6770
# see https://github.com/gitalk/gitalk
6871
gitalk:
72+
enable:false
6973
autoExpand:false
7074
clientID:''
7175
clientSecret:''
@@ -76,6 +80,18 @@ gitalk:
7680
id:location.pathname
7781
# Facebook-like distraction
7882

83+
# Valine comment plugin (recommended!)
84+
# see https://valine.js.org/quickstart.html
85+
valine:
86+
enable:true
87+
app_id:
88+
app_key:
89+
notify:false
90+
verify:false
91+
avatar:'mp'
92+
placeholder:'Leave your throughs behind~'
93+
visitor:true
94+
7995
# Enable symbols-count-time plugin
8096
# see https://github.com/theme-next/hexo-symbols-count-time
8197
symbols_count_time:

‎layout/_partial/head.ejs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var description = '';
3636
<linkhref="/font/Rubik-Bold-kern-latin.woff2"as="font"type="font/woff2"crossorigin="">
3737
<linkhref="/font/Rubik-Regular-kern-latin.woff2"as="font"type="font/woff2"crossorigin="">
3838
<%-css(['//cdn.bootcss.com/gitalk/1.5.0/gitalk.min.css'])%>
39-
<%-css(['//at.alicdn.com/t/font_1429596_2c4p9wqp87z.css'])%>
39+
<%-css(['//at.alicdn.com/t/font_1429596_zzm0n7wzdk.css'])%>
4040
<%-css(['css/obsidian.css'])%>
4141
<%-css(['//cdn.bootcss.com/animate.css/3.7.2/animate.min.css'])%>
4242
</head>

‎layout/_partial/post/article.ejs‎

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929
)%>
3030
</span>
3131
<% }%>
32+
<%if (theme.valine.enable==true&&theme.valine.visitor==true) {%>
33+
<span id="<%- '/' + page.path %>"class="leancloud_visitors" data-flag-title="<%- page.title %>">
34+
<bclass="iconfont icon-read"></b>
35+
<iclass="leancloud-visitors-count">1000000</i>
36+
</span>
37+
<% }%>
3238
</p>
3339
<% }%>
3440
<%if (page.tags&&page.tags.length){%>
@@ -53,9 +59,9 @@
5359
</div>
5460
</div>
5561

56-
<divclass="article animated fadeIn">
62+
<divclass="article">
5763
<divclass='main'>
58-
<divclass="content markdown">
64+
<divclass="content markdown animated fadeIn slower">
5965
<%-page.content%>
6066
<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->
6167
<audioid="audio"loop="1"preload="auto"controls="controls"data-autoplay="<%- theme.autoplay || page.autoplay ||"false" %>">
@@ -72,13 +78,38 @@
7278
<%}%>
7379
</ul>
7480
<%}%>
81+
<%if (theme.gitalk.enable==true){%>
82+
<%-partial('gitalk', {post: page})%>
83+
<% }%>
84+
<%if (theme.valine.enable==true){%>
85+
<div id="vcomments"></div>
86+
<% }%>
7587
</div>
76-
<%-partial('gitalk', {post: page})%>
77-
</div>
78-
<%if (theme.TOC==true){%>
79-
<divclass='side'>
80-
<%-toc(page.content, {list_number:true})%>
88+
<divclass="sidebar">
89+
<divclass="box animated fadeInRight">
90+
<divclass="subbox">
91+
<imgsrc="<%- theme.avatar %>"height=300width=300></img>
92+
<p><%-config.author%></p>
93+
<span><%-theme.descriptionOne%></span>
94+
</div>
95+
<ul>
96+
<li><ahref="/"><%-site.posts.length%> <p>文章</p></a></li>
97+
<li><ahref="/categories"><%-site.categories.length%> <p>分类</p></a></li>
98+
<li><ahref="/tags"><%-site.tags.length%> <p>标签</p></a></li>
99+
</ul>
100+
</div>
101+
<%if (theme.TOC==true) {%>
102+
<% toc=toc(page.content, {list_number:true})%>
103+
<%if (toc.length>1) {%>
104+
<divclass="box sticky animated fadeInRight faster">
105+
<div id="toc"class="subbox">
106+
<h4>目录</h4>
107+
<%- toc%>
108+
</div>
109+
</div>
110+
<%}%>
111+
<%}%>
81112
</div>
82-
<%}%>
113+
</div>
83114
</div>
84115

‎layout/_partial/post/item.ejs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
)%>
2727
</span>
2828
<% }%>
29+
<%if (theme.valine.enable==true&&theme.valine.visitor==true) {%>
30+
<span id="<%- '/' + post.path %>"class="leancloud_visitors" data-flag-title="<%- page.title %>">
31+
<bclass="iconfont icon-read"></b>
32+
<iclass="leancloud-visitors-count">1000000</i>
33+
</span>
34+
<% }%>
2935
</p>
3036
<% }%>
3137
<divclass="md-content">

‎layout/_partial/screen.ejs‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@
4545
)%>
4646
</span>
4747
<% }%>
48+
<%if (theme.valine.enable==true&&theme.valine.visitor==true) {%>
49+
<span id="<%- '/' + first.path %>"class="leancloud_visitors" data-flag-title="<%- page.title %>">
50+
<bclass="iconfont icon-read"></b>
51+
<iclass="leancloud-visitors-count">1000000</i>
52+
</span>
53+
<% }%>
4854
</p>
4955
<% }%>
5056
<divclass="md-content animated fadeIn">

‎layout/_partial/scripts.ejs‎

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<%-js(['//cdn.bootcss.com/gitalk/1.5.0/gitalk.min.js'])%>
22
<%-js(['//lib.baomitu.com/jquery/1.8.3/jquery.min.js','js/plugin.js','js/obsidian.js','js/jquery.truncate.js'])%>
33
<%-js(['//cdn.bootcss.com/typed.js/2.0.10/typed.min.js'])%>
4+
45
<%-partial('photoswipe')%>
56

67
<%if (!config.highlightjs) {%>
@@ -36,4 +37,29 @@
3637
initialTyped();
3738
});
3839
}
39-
</script>
40+
</script>
41+
42+
<%if (theme.valine.enable) {%>
43+
<%-js(['//unpkg.com/valine/dist/Valine.min.js'])%>
44+
<script>
45+
46+
var valine=newValine();
47+
48+
functioninitValine() {
49+
valine.init({
50+
el:'#vcomments',
51+
appId:'<%- theme.valine.app_id %>',
52+
appKey:'<%- theme.valine.app_key %>',
53+
notify:'<%- theme.valine.notify %>',
54+
verify:'<%- theme.valine.verify %>',
55+
avatar:'<%- theme.valine.avatar %>',
56+
placeholder:'<%- theme.valine.placeholder %>',
57+
visitor:<%-theme.valine.visitor%>
58+
});
59+
}
60+
61+
$(document).ready(function () {
62+
initValine();
63+
})
64+
</script>
65+
<% }%>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp