Skip to content

Commit 78971f3

Browse files
committed
update v1.2.0
1 parent 0f6f4ec commit 78971f3

22 files changed

+411
-45
lines changed

Diff for: CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## 🚀 1.2.0 (Oct 15, 2019)
4+
5+
Enhanced bunch of features and add bunch of fun stuffs. Hope you all enjoy them!
6+
7+
### Features ✨
8+
- Added English language support! Hooray!
9+
- Home page added "Read article" so it's more clean that it's just a summary, click to read full article.
10+
- Added back to top button, also with a fun progress tracking effect!
11+
- Footer theme added theme version display.
12+
- Article added a parameter to set the number of characters this particular article should keep.
13+
14+
### Changes 🙌
15+
- Added sticky effect for both home page and article page navigation bar, with auto hide when scroll, allow reading with less undistraction.
16+
- Readded google analytics js, which was removed before.
17+
- Article top progress bar is enlarged to more catch eyeballs.
18+
19+
### Bug fixes 🐛
20+
- Fixed slogan height shaking issue.
21+
- Fixed screen flashes when scrolling.
22+
323
## 🚀 1.1.0 (Oct 12, 2019)
424

525
Added a few more features and enhanced a bit here and there. Have fun and enjoy blogging! ❤️

Diff for: README.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Hexo-theme-obsidian
1+
# Hexo-theme-obsidian <sup>v1.2.0</sup>
22
> A dark Hexo theme, it's responsive, simple but elegant.
33
44
**[PREVIEW](http://tridiamond.tech)** |
@@ -179,6 +179,26 @@ highlight:
179179
hexo clean && hexo g
180180
```
181181

182+
### Preview character length
183+
184+
This post parameter changes how many characters are kept for the preview at home page.
185+
186+
``` markdown
187+
188+
title: My awesome title
189+
date: 2019-07-14 18:38:45
190+
categories:
191+
- Category1
192+
- Category2
193+
tags:
194+
- Tag1
195+
- Tag2
196+
mp3: http://domain.com/awesome.mp3
197+
cover: http://domain.com/awesome.jpg
198+
preview: 300
199+
200+
```
201+
182202
### Post template
183203

184204
Post template settings

Diff for: README_CN.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Hexo-theme-obsidian
1+
# Hexo-theme-obsidian <sup>v1.2.0</sup>
22
> 一款暗色的Hexo主题, 拥有响应式布局, 简约而优雅.
33
44
**[预览](http://tridiamond.tech)** |
@@ -175,6 +175,26 @@ highlight:
175175
hexo clean && hexo g
176176
```
177177

178+
### 文章展示字符数控制
179+
180+
文章里面的参数`preview`控制在首页展示时保留的字符数
181+
182+
``` markdown
183+
184+
title: My awesome title
185+
date: 2019-07-14 18:38:45
186+
categories:
187+
- Category1
188+
- Category2
189+
tags:
190+
- Tag1
191+
- Tag2
192+
mp3: http://domain.com/awesome.mp3
193+
cover: http://domain.com/awesome.jpg
194+
preview: 300
195+
196+
```
197+
178198
### 文章模版
179199

180200
文章模版设置

Diff for: languages/default.yml

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
articles: Articles
12
categories: Categories
23
search: Search
34
tags: Tags
@@ -20,3 +21,10 @@ tag: Tag
2021
nav.category: Category
2122
nav.tag: Tag
2223
nav.archive: Archive
24+
time_suffix: mins.
25+
load_more: Load more
26+
toc: Contents
27+
read_article: Read article
28+
pv: Page views
29+
uv: Unique visitors
30+
readed: Readed

Diff for: languages/fr.yml

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
articles: Articles
12
categories: Catégories
23
search: Rechercher
34
tags: Mot-clés
@@ -17,3 +18,10 @@ powered_by: Propulsé by
1718
rss_feed: Flux RSS
1819
category: Catégorie
1920
tag: Mot-clé
21+
time_suffix: mins.
22+
load_more: Load more
23+
toc: Contents
24+
read_article: Read article
25+
pv: Page views
26+
uv: Unique visitors
27+
readed: Readed

Diff for: languages/it.yml

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
articles: Articles
12
categories: Categorie
23
search: Cerca
34
tags: Tag
@@ -17,3 +18,10 @@ powered_by: Powered by
1718
rss_feed: Feed RSS
1819
category: Categoria
1920
tag: Tag
21+
time_suffix: mins.
22+
load_more: Load more
23+
toc: Contents
24+
read_article: Read article
25+
pv: Page views
26+
uv: Unique visitors
27+
readed: Readed

Diff for: languages/nl.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
articles: Articles
22
categories: Categorieën
33
search: Zoeken
44
tags: Labels
@@ -18,3 +18,10 @@ powered_by: Powered by
1818
rss_feed: RSS Feed
1919
category: Categorie
2020
tag: Label
21+
time_suffix: mins.
22+
load_more: Load more
23+
toc: Contents
24+
read_article: Read article
25+
pv: Page views
26+
uv: Unique visitors
27+
readed: Readed

Diff for: languages/no.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
articles: Articles
12
categories: Kategorier
23
search: Søk
34
tags: Tags
@@ -16,4 +17,11 @@ share: Share
1617
powered_by: Powered by
1718
rss_feed: RSS Feed
1819
category: Category
19-
tag: Tag
20+
tag: Tag
21+
time_suffix: mins.
22+
load_more: Load more
23+
toc: Contents
24+
read_article: Read article
25+
pv: Page views
26+
uv: Unique visitors
27+
readed: Readed

Diff for: languages/ru.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
articles: Articles
12
categories: Категории
23
search: Поиск
34
tags: Метки
@@ -16,4 +17,11 @@ share: Поделиться
1617
powered_by: Создано с помощью
1718
rss_feed: RSS-каналы
1819
category: Категория
19-
tag: Метка
20+
tag: Метка
21+
time_suffix: mins.
22+
load_more: Load more
23+
toc: Contents
24+
read_article: Read article
25+
pv: Page views
26+
uv: Unique visitors
27+
readed: Readed

Diff for: languages/zh-CN.yml

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
articles: 文章
12
categories: 分类
23
search: 搜索
34
tags: 标签
@@ -20,3 +21,11 @@ tag: Tag
2021
nav.category: 分类
2122
nav.tag: 标签
2223
nav.archive: 归档
24+
time_suffix: 分钟
25+
load_more: 加载更多
26+
loading: 加载中...
27+
toc: 目录
28+
read_article: 查看全文
29+
pv: 浏览量
30+
uv: 访客数
31+
readed: 已读

Diff for: languages/zh-TW.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
articles: 文章
12
categories: 分類
23
search: 搜尋
34
tags: 標籤
@@ -16,4 +17,12 @@ share: Share
1617
powered_by: Powered by
1718
rss_feed: RSS Feed
1819
category: Category
19-
tag: Tag
20+
tag: Tag
21+
time_suffix: mins.
22+
load_more: Load more
23+
loading: Loading...
24+
toc: Contents
25+
read_article: Read article
26+
pv: Page views
27+
uv: Unique visitors
28+
readed: Readed

Diff for: layout/_partial/head.ejs

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var description = '';
3636
<link href="/font/Rubik-Bold-kern-latin.woff2" as="font" type="font/woff2" crossorigin="">
3737
<link href="/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_zzm0n7wzdk.css'])%>
39+
<%- css(['//at.alicdn.com/t/font_1429596_0wwj85c9fst.css'])%>
4040
<%- css(['css/obsidian.css'])%>
4141
<%- css(['//cdn.bootcss.com/animate.css/3.7.2/animate.min.css'])%>
4242
</head>

Diff for: layout/_partial/post/article.ejs

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
url(<%- page.cover || theme.welcome_cover %>);">
99
</div>
1010
<div class="else">
11-
<p class="animated fadeInDown"><%- page.date.locale("zh-cn").format("MMMM DD, YYYY") %></p>
11+
<p class="animated fadeInDown"><%- page.date.locale(config.language || '').format("MMMM DD, YYYY") %></p>
1212
<h3 class="animated fadeInDown"><%- link_to(page.path, page.title || "Untitled", {class: ""}) %></h3>
1313
<% if (theme.symbols_count_time.enable) {%>
1414
<p class="post-count animated fadeInDown">
@@ -98,17 +98,17 @@
9898
</dl>
9999
</div>
100100
<ul>
101-
<li><a href="/"><%- site.posts.length %> <p>文章</p></a></li>
102-
<li><a href="/categories"><%- site.categories.length %> <p>分类</p></a></li>
103-
<li><a href="/tags"><%- site.tags.length %> <p>标签</p></a></li>
101+
<li><a href="/"><%- site.posts.length %> <p><%= __('articles') %></p></a></li>
102+
<li><a href="/categories"><%- site.categories.length %> <p><%= __('categories') %></p></a></li>
103+
<li><a href="/tags"><%- site.tags.length %> <p><%= __('tags') %></p></a></li>
104104
</ul>
105105
</div>
106106
<% if (theme.TOC == true) { %>
107107
<% toc = toc(page.content, {list_number: true}) %>
108108
<% if (toc.length > 1) { %>
109109
<div class="box sticky animated fadeInRight faster">
110110
<div id="toc" class="subbox">
111-
<h4>目录</h4>
111+
<h4><%= __('toc') %></h4>
112112
<%- toc %>
113113
</div>
114114
</div>

Diff for: layout/_partial/post/header.ejs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1+
<div class="scrollbar gradient-bg-rev"></div>
12
<div id="top" style="display: block;">
23
<div class="bar" style="width: 0;"></div>
34
<a class="icon-home image-icon" href="javascript:;" data-url="<%= config.url %>"></a>
4-
<div title="播放/暂停" class="icon-play"></div>
5+
<div title="Play/Pause" class="icon-play"></div>
56
<h3 class="subtitle"><%- page.title %></h3>
67
<div class="social">
7-
<!--<div class="like-icon">-->
8-
<!--<a href="javascript:;" class="likeThis active"><span class="icon-like"></span><span class="count">76</span></a>-->
9-
<!--</div>-->
8+
<!-- <div class="like-icon">-->
9+
<!-- <a href="javascript:;" class="likeThis active"><span class="icon-like"></span><span class="count">76</span></a>-->
10+
<!-- </div>-->
1011
<div>
1112
<div class="share">
12-
<a title="获取二维码" class="icon-scan" href="javascript:;"></a>
13+
<a title="Get qrcode" class="icon-scan" href="javascript:;"></a>
1314
</div>
1415
<div id="qr"></div>
1516
</div>
1617
</div>
17-
<div class="scrollbar"></div>
1818
</div>

Diff for: layout/_partial/post/item.ejs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
url(<%- post.cover || theme.cover %>);">
66
</div>
77
<div class="else">
8-
<p><%- post.date.locale("zh-cn").format("MMMM DD, YYYY") %></p>
8+
<p><%- post.date.locale(config.language || '').format("MMMM DD, YYYY") %></p>
99
<h3><%- link_to(post.path, post.title || "Untitled", {class: "posttitle"}) %></h3>
1010
<% if (theme.symbols_count_time.enable) {%>
1111
<p class="post-count animated fadeInDown">
@@ -48,6 +48,7 @@
4848
omission: '...'
4949
}) %>
5050
<% } %>
51+
<span class="read-more gradient-text"><%- link_to(post.path, __('read_article', 'Read article'), {class: "posttitle"}) %></span>
5152
</div>
5253
<% if (post.tags && post.tags.length){ %>
5354
<%- list_tags(post.tags, {

Diff for: layout/_partial/screen.ejs

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
</div>
2525
<% if ( first ) { %>
2626
<div id="post0">
27-
<p class="animated fadeInDown"><%- first.date.locale("zh-cn").format("MMMM DD, YYYY") %></p>
27+
<p class="animated fadeInDown"><%- first.date.locale(config.language || '').format("MMMM DD, YYYY") %></p>
2828
<h1 class="animated fadeInDown"><%- link_to(first.path, first.title || config.title, {class: "posttitle"}) %></h1>
2929
<% if (theme.symbols_count_time.enable) {%>
3030
<p class="post-count animated fadeInDown">
@@ -67,6 +67,7 @@
6767
omission: '...'
6868
}) %>
6969
<% } %>
70+
<span class="read-more gradient-text"><%- link_to(first.path, __('read_article', 'Read article'), {class: "posttitle"}) %></span>
7071
</div>
7172
<% if (first.tags && first.tags.length){ %>
7273
<%- list_tags(first.tags, {
@@ -83,7 +84,7 @@
8384
<div class="screen-gradient-content-inside">
8485
<div class="bold-underline-links screen-gradient-sponsor">
8586
<p>
86-
<span class="typed-text"></span>
87+
<span class="typed-text"></span>
8788
</p>
8889
</div>
8990
</div>

Diff for: layout/_partial/scripts.ejs

+22-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@
44

55
<%- partial('photoswipe') %>
66

7+
<% if (theme.google_analytics) { %>
8+
<!-- Global site tag (gtag.js) - Google Analytics -->
9+
<script async src="https://www.googletagmanager.com/gtag/js?id=<%- theme.google_analytics %>"></script>
10+
<script>
11+
window.dataLayer = window.dataLayer || [];
12+
function gtag(){dataLayer.push(arguments);}
13+
gtag('js', new Date());
14+
15+
gtag('config', '<%- theme.google_analytics %>');
16+
</script>
17+
<% } %>
18+
19+
720
<% if (!config.highlightjs) { %>
821
<!-- Highlight.js -->
922
<%- css(['css/dracula.css'])%>
@@ -46,6 +59,12 @@
4659
var valine = new Valine();
4760
4861
function initValine() {
62+
let language = '<%- config.language %>';
63+
if (!language) {
64+
language = 'en';
65+
} else {
66+
language = language.toLowerCase();
67+
}
4968
valine.init({
5069
el: '#vcomments',
5170
appId: '<%- theme.valine.app_id %>',
@@ -54,12 +73,13 @@
5473
verify: '<%- theme.valine.verify %>',
5574
avatar: '<%- theme.valine.avatar %>',
5675
placeholder: '<%- theme.valine.placeholder %>',
57-
visitor: <%- theme.valine.visitor %>
76+
visitor: '<%- theme.valine.visitor %>',
77+
lang: language
5878
});
5979
}
6080
6181
$(document).ready(function () {
6282
initValine();
63-
})
83+
});
6484
</script>
6585
<% } %>

0 commit comments

Comments
 (0)