|
1 | 1 | #Hexo-theme-obsidian |
| 2 | +>A dark Hexo theme, it's responsive, simple but elegant. |
2 | 3 |
|
| 4 | +**[PREVIEW](http://tridiamond.tech)** | |
| 5 | +**[中文文档](https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/README_CN.md)** |
3 | 6 |
|
4 | | -**[在线预览 | PREVIEW](http://tridiamond.tech)** |
| 7 | + |
5 | 8 |
|
6 | | -⚫️ 一款优雅而高尚的黑色主题, 响应式, 高质量, 有趣, 优雅, 简约但不简单。 |
7 | | - |
8 | | ---- |
9 | | - |
10 | | -⚫️ A noble dark obsidian style Hexo theme, it's responsive, hight quality, fancy, high class. |
11 | | - |
12 | | - |
13 | | - |
14 | | -###安装主题 |
| 9 | +##Install |
15 | 10 |
|
16 | 11 | ```bash |
17 | 12 | $ git clone https://github.com/TriDiamond/hexo-theme-obsidian.git obsidian |
18 | 13 | ``` |
19 | 14 |
|
| 15 | +##Usage |
20 | 16 |
|
21 | | -###启用主题 |
22 | | - |
23 | | -修改Hexo配置文件`_config.yml` 主题项设置为obsidian |
| 17 | +###Activate Theme |
24 | 18 |
|
| 19 | +Open`Hexo` config file`_config.yml`, set theme to`obsidian` |
25 | 20 |
|
26 | 21 | ```yaml |
27 | | - |
28 | 22 | ... |
29 | 23 | theme:obsidian |
30 | 24 | ... |
31 | 25 | ``` |
32 | | -###更新主题 |
33 | 26 |
|
34 | | -注意:请在更时主题时备份`_config.yml`配置文件 |
| 27 | +###Theme settings |
35 | 28 |
|
36 | | -```bash |
37 | | -cd themes/diaspora |
38 | | -git pull |
| 29 | +Open`/themes/obsidian/_config.yml` can change the theme configs |
| 30 | + |
| 31 | +```yaml |
| 32 | + |
| 33 | +#! --------------------------------------------------------------- |
| 34 | +#! Obsidian theme use manual highlight.js |
| 35 | +#! To maintain the code block css display properly |
| 36 | +#! please change your default highlight setting as off!! |
| 37 | +#! --------------------------------------------------------------- |
| 38 | +#! highlight: |
| 39 | +#! enable: false |
| 40 | +#! line_number: true |
| 41 | +#! auto_detect: true |
| 42 | +#! tab_replace: |
| 43 | +#! --------------------------------------------------------------- |
| 44 | + |
| 45 | +# --------------------------------------------------------------- |
| 46 | +# Theme default settings |
| 47 | +# --------------------------------------------------------------- |
| 48 | + |
| 49 | +# Menu setting | format = title_name: link_url |
| 50 | +menu: |
| 51 | +PAGE:/page |
| 52 | + |
| 53 | +# Enable table of content |
| 54 | +TOC:false |
| 55 | + |
| 56 | +# Home page first post default cover image, default use cover |
| 57 | +welcome_cover:/img/cover.jpg |
| 58 | + |
| 59 | +# Article default cover image |
| 60 | +cover:/img/welcome-cover.jpg |
| 61 | + |
| 62 | +# Disable default scrollbar |
| 63 | +scrollbar:true |
| 64 | + |
| 65 | +# Website keywords used for SEO |
| 66 | +keywords:TriDiamond Obsidian |
| 67 | + |
| 68 | +# Website slogans |
| 69 | +descriptionOne:"Think like an artist, develop like an artisan" |
| 70 | +descriptionTwo:"艺术家思维去思考问题,工匠创造精神去开发" |
| 71 | + |
| 72 | +# If you use google analytics, please fill in the ID |
| 73 | +google_analytics: |
| 74 | + |
| 75 | +# Website favicon |
| 76 | +favicon:/img/favicon.png |
| 77 | + |
| 78 | +# rss file |
| 79 | +rss:atom.xml |
| 80 | + |
| 81 | +# --------------------------------------------------------------- |
| 82 | +# Article Music settings |
| 83 | +# --------------------------------------------------------------- |
| 84 | + |
| 85 | +# Auto play article audio |
| 86 | +autoplay:false |
| 87 | + |
| 88 | +# default mp3 file |
| 89 | +mp3: |
| 90 | + -statics/chengdu.mp3 |
| 91 | + |
| 92 | +# --------------------------------------------------------------- |
| 93 | +# Plugins |
| 94 | +# --------------------------------------------------------------- |
| 95 | + |
| 96 | +# Gitalk comment plugin |
| 97 | +# see https://github.com/gitalk/gitalk |
| 98 | +gitalk: |
| 99 | +autoExpand:false |
| 100 | +clientID:'' |
| 101 | +clientSecret:'' |
| 102 | +repo:'' |
| 103 | +owner:'' |
| 104 | +admin:[''] |
| 105 | +# Ensure uniqueness and length less than 50 |
| 106 | +id:location.pathname |
| 107 | +# Facebook-like distraction |
| 108 | + |
| 109 | +# Enable symbols-count-time plugin |
| 110 | +# see https://github.com/theme-next/hexo-symbols-count-time |
| 111 | +symbols_count_time: |
| 112 | +enable:true |
| 113 | +wordCount:true |
| 114 | +readCount:true |
| 115 | +awl:4 |
| 116 | +wpm:275 |
| 117 | +suffix:mins. |
| 118 | + |
| 119 | +# Enable html truncate |
| 120 | +# see https://github.com/TriDiamond/hexo-html-truncate |
| 121 | +html_truncate: |
| 122 | +enable:true |
| 123 | +# Characters kept for posts |
| 124 | +postLength:250 |
| 125 | +# Characters kept for cover posts |
| 126 | +coverLength:100 |
| 127 | +ellipsis:'...' |
| 128 | +# Excluding html tags |
| 129 | +excludes:['img'] |
| 130 | +# Characters count including white spaces |
| 131 | +keepWhitespaces:true |
| 132 | +# Reserving the last complete word, without breaking the word |
| 133 | +reserveLastWord:true |
| 134 | + |
39 | 135 | ``` |
40 | 136 |
|
| 137 | +### Code block style |
| 138 | +
|
| 139 | +> Turn off default`highlight` to ensure code block style display properly. |
| 140 | +Because Obsidian theme use manual highlight.js |
| 141 | +To maintain the code block css display properly |
| 142 | +please change your default highlight setting as off. |
| 143 | + |
| 144 | +```yaml |
| 145 | +... |
41 | 146 |
|
42 | | -###新建文章模板 |
| 147 | +highlight: |
| 148 | + enable: false |
| 149 | + line_number: true |
| 150 | + auto_detect: true |
| 151 | + tab_replace: |
| 152 | +
|
| 153 | +... |
| 154 | +``` |
| 155 | + |
| 156 | +### Post template |
| 157 | + |
| 158 | +Post template settings |
43 | 159 |
|
44 | 160 | ``` markdown |
45 | | ---- |
| 161 | +
|
46 | 162 | title: My awesome title |
47 | | -date:2016-10-12 18:38:45 |
48 | | -categories: |
49 | | - -分类1 |
50 | | - -分类2 |
| 163 | +date:2019-07-14 18:38:45 |
| 164 | +categories: |
| 165 | + -Category1 |
| 166 | + -Category2 |
51 | 167 | tags: |
52 | | - -标签1 |
53 | | - -标签2 |
| 168 | + -Tag1 |
| 169 | + -Tag2 |
54 | 170 | mp3: http://domain.com/awesome.mp3 |
55 | 171 | cover: http://domain.com/awesome.jpg |
56 | | ---- |
57 | | -``` |
58 | 172 |
|
59 | | -###创建分类页 |
60 | | -1 新建一个页面,命名为 categories 。命令如下: |
61 | 173 | ``` |
| 174 | + |
| 175 | +### Create categories page |
| 176 | + |
| 177 | +Run Hexo command to generate categories page |
| 178 | + |
| 179 | +```bash |
62 | 180 | hexo new page categories |
63 | 181 | ``` |
64 | | -2 编辑刚新建的页面,将页面的类型设置为 categories |
| 182 | + |
| 183 | +Categories template |
| 184 | + |
65 | 185 | ``` |
66 | 186 | title: categories |
67 | | -date:2014-12-22 12:39:04 |
| 187 | +date:2019-07-14 12:39:04 |
68 | 188 | type: "categories" |
69 | | ---- |
70 | 189 | ``` |
71 | | -主题将自动为这个页面显示所有分类。 |
72 | 190 |
|
73 | | -###创建标签页 |
74 | | -1 新建一个页面,命名为 tags 。命令如下: |
75 | | -``` |
| 191 | +> Theme will auto generate categories contents. |
| 192 | +
|
| 193 | +### Create tags page |
| 194 | +
|
| 195 | +Run Hexo command to generate tags page |
| 196 | +
|
| 197 | +```bash |
76 | 198 | hexo new page tags |
77 | 199 | ``` |
78 | | -2 编辑刚新建的页面,将页面的类型设置为 tags |
| 200 | + |
| 201 | +Tags page template |
| 202 | + |
79 | 203 | ``` |
80 | 204 | title: tags |
81 | 205 | date: 2014-12-22 12:39:04 |
82 | 206 | type: "tags" |
83 | | ---- |
84 | 207 | ``` |
85 | | -主题将自动为这个页面显示所有标签。 |
86 | | - |
87 | 208 |
|
88 | | -###主题配置 |
89 | | -```yml |
90 | | -# 头部菜单,title: link |
91 | | -menu: |
92 | | -Whoami:/whoami |
93 | | -Github:https://github.com/TriDiamond |
94 | | -Twitter:https://twitter.com/TriDiamond6 |
95 | | -分类:/categories |
96 | | -归档:/archives |
97 | | -标签云:/tags |
98 | | - |
99 | | -# 是否显示目录 |
100 | | -TOC:false |
101 | | - |
102 | | -# 是否自动播放音乐 |
103 | | -autoplay:false |
104 | | - |
105 | | -# 默认音乐(随机播放) |
106 | | -mp3: |
107 | | - -http://link.hhtjim.com/163/425570952.mp3 |
108 | | - -http://link.hhtjim.com/163/425570952.mp3 |
| 209 | +>Theme will auto generate tags contents. |
109 | 210 |
|
110 | | -# 首页封面图, 为空时取文章的cover作为封面 |
111 | | -welcome_cover:# /img/welcome-cover.jpg |
| 211 | +##Update Theme |
112 | 212 |
|
113 | | -# 默认文章封面图 |
114 | | -cover:/img/cover.jpg |
115 | | - |
116 | | -# Gitalk 评论插件(https://github.com/gitalk/gitalk) |
117 | | -gitalk: |
118 | | -# 是否自动展开评论框 |
119 | | -autoExpand:false |
120 | | -# 应用编号 |
121 | | -clientID:'' |
122 | | -# 应用秘钥 |
123 | | -clientSecret:'' |
124 | | -# issue仓库名 |
125 | | -repo:'' |
126 | | -# Github名 |
127 | | -owner:'' |
128 | | -# Github名 |
129 | | -admin:[''] |
130 | | -# Ensure uniqueness and length less than 50 |
131 | | -id:location.pathname |
132 | | -# Facebook-like distraction free mode |
133 | | -distractionFreeMode:false |
134 | | - |
135 | | -# 网站关键字 |
136 | | -keywords:Fechin |
137 | | - |
138 | | -# 要使用google_analytics进行统计的话,这里需要配置ID |
139 | | -google_analytics: |
140 | | - |
141 | | -# 网站ico |
142 | | -favicon:/img/favicon.png |
143 | | - |
144 | | -# rss文件 |
145 | | -rss:atom.xml |
146 | | -``` |
| 213 | +>Please backup your`_config.yml` file before update |
147 | 214 |
|
| 215 | +```bash |
| 216 | +cd themes/osidian |
| 217 | +git pull |
| 218 | +``` |