Skip to content

Commit

Permalink
Complete rebuild
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyxguo committed Oct 11, 2019
1 parent e2dc49c commit 4aa634e
Show file tree
Hide file tree
Showing 26 changed files with 2,969 additions and 1,469 deletions.
3 changes: 3 additions & 0 deletions .gitignore
@@ -0,0 +1,3 @@
/source/statics/*
CNAME
opensource.json
269 changes: 170 additions & 99 deletions README.md
@@ -1,147 +1,218 @@
# Hexo-theme-obsidian
> A dark Hexo theme, it's responsive, simple but elegant.
**[PREVIEW](http://tridiamond.tech)** |
**[中文文档](https://github.com/TriDiamond/hexo-theme-obsidian/blob/master/README_CN.md)**

**[在线预览 | PREVIEW ](http://tridiamond.tech)**
![screenshot](https://s2.ax1x.com/2019/10/01/uNBcND.png)

⚫️ 一款优雅而高尚的黑色主题, 响应式, 高质量, 有趣, 优雅, 简约但不简单。

---

⚫️ A noble dark obsidian style Hexo theme, it's responsive, hight quality, fancy, high class.

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

### 安装主题
## Install

``` bash
$ git clone https://github.com/TriDiamond/hexo-theme-obsidian.git obsidian
```

## Usage

### 启用主题

修改Hexo配置文件 `_config.yml` 主题项设置为obsidian
### Activate Theme

Open `Hexo` config file `_config.yml`, set theme to `obsidian`

``` yaml

...
theme: obsidian
...
```
### 更新主题

注意:请在更时主题时备份`_config.yml`配置文件
### Theme settings

``` bash
cd themes/diaspora
git pull
Open `/themes/obsidian/_config.yml` can change the theme configs

``` yaml

#! ---------------------------------------------------------------
#! Obsidian theme use manual highlight.js
#! To maintain the code block css display properly
#! please change your default highlight setting as off!!
#! ---------------------------------------------------------------
#! highlight:
#! enable: false
#! line_number: true
#! auto_detect: true
#! tab_replace:
#! ---------------------------------------------------------------

# ---------------------------------------------------------------
# Theme default settings
# ---------------------------------------------------------------

# Menu setting | format = title_name: link_url
menu:
PAGE: /page

# Enable table of content
TOC: false

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

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

# Disable default scrollbar
scrollbar: true

# Website keywords used for SEO
keywords: TriDiamond Obsidian

# Website slogans
descriptionOne: "Think like an artist, develop like an artisan"
descriptionTwo: "艺术家思维去思考问题,工匠创造精神去开发"

# If you use google analytics, please fill in the ID
google_analytics:

# Website favicon
favicon: /img/favicon.png

# rss file
rss: atom.xml

# ---------------------------------------------------------------
# Article Music settings
# ---------------------------------------------------------------

# Auto play article audio
autoplay: false

# default mp3 file
mp3:
- statics/chengdu.mp3

# ---------------------------------------------------------------
# Plugins
# ---------------------------------------------------------------

# Gitalk comment plugin
# see https://github.com/gitalk/gitalk
gitalk:
autoExpand: false
clientID: ''
clientSecret: ''
repo: ''
owner: ''
admin: ['']
# Ensure uniqueness and length less than 50
id: location.pathname
# Facebook-like distraction

# Enable symbols-count-time plugin
# see https://github.com/theme-next/hexo-symbols-count-time
symbols_count_time:
enable: true
wordCount: true
readCount: true
awl: 4
wpm: 275
suffix: mins.

# Enable html truncate
# see https://github.com/TriDiamond/hexo-html-truncate
html_truncate:
enable: true
# Characters kept for posts
postLength: 250
# Characters kept for cover posts
coverLength: 100
ellipsis: '...'
# Excluding html tags
excludes: ['img']
# Characters count including white spaces
keepWhitespaces: true
# Reserving the last complete word, without breaking the word
reserveLastWord: true

```

### Code block style

> Turn off default `highlight` to ensure code block style display properly.
Because Obsidian theme use manual highlight.js
To maintain the code block css display properly
please change your default highlight setting as off.

```yaml
...

### 新建文章模板
highlight:
enable: false
line_number: true
auto_detect: true
tab_replace:

...
```

### Post template

Post template settings

``` markdown
---

title: My awesome title
date: 2016-10-12 18:38:45
categories:
- 分类1
- 分类2
date: 2019-07-14 18:38:45
categories:
- Category1
- Category2
tags:
- 标签1
- 标签2
- Tag1
- Tag2
mp3: http://domain.com/awesome.mp3
cover: http://domain.com/awesome.jpg
---
```

### 创建分类页
1 新建一个页面,命名为 categories 。命令如下:
```

### Create categories page

Run Hexo command to generate categories page

```bash
hexo new page categories
```
2 编辑刚新建的页面,将页面的类型设置为 categories

Categories template

```
title: categories
date: 2014-12-22 12:39:04
date: 2019-07-14 12:39:04
type: "categories"
---
```
主题将自动为这个页面显示所有分类。

### 创建标签页
1 新建一个页面,命名为 tags 。命令如下:
```
> Theme will auto generate categories contents.
### Create tags page

Run Hexo command to generate tags page

```bash
hexo new page tags
```
2 编辑刚新建的页面,将页面的类型设置为 tags

Tags page template

```
title: tags
date: 2014-12-22 12:39:04
type: "tags"
---
```
主题将自动为这个页面显示所有标签。


### 主题配置
```yml
# 头部菜单,title: link
menu:
Whoami: /whoami
Github: https://github.com/TriDiamond
Twitter: https://twitter.com/TriDiamond6
分类: /categories
归档: /archives
标签云: /tags

# 是否显示目录
TOC: false

# 是否自动播放音乐
autoplay: false

# 默认音乐(随机播放)
mp3:
- http://link.hhtjim.com/163/425570952.mp3
- http://link.hhtjim.com/163/425570952.mp3
> Theme will auto generate tags contents.
# 首页封面图, 为空时取文章的cover作为封面
welcome_cover: # /img/welcome-cover.jpg
## Update Theme

# 默认文章封面图
cover: /img/cover.jpg

# Gitalk 评论插件(https://github.com/gitalk/gitalk)
gitalk:
# 是否自动展开评论框
autoExpand: false
# 应用编号
clientID: ''
# 应用秘钥
clientSecret: ''
# issue仓库名
repo: ''
# Github名
owner: ''
# Github名
admin: ['']
# Ensure uniqueness and length less than 50
id: location.pathname
# Facebook-like distraction free mode
distractionFreeMode: false

# 网站关键字
keywords: Fechin

# 要使用google_analytics进行统计的话,这里需要配置ID
google_analytics:

# 网站ico
favicon: /img/favicon.png

# rss文件
rss: atom.xml
```
> Please backup your `_config.yml` file before update
``` bash
cd themes/osidian
git pull
```

0 comments on commit 4aa634e

Please sign in to comment.