提交 9c02f00c 编写于 作者: EvanOne(文一)'s avatar EvanOne(文一)

docs: Update docs

上级 9c43f99e
......@@ -2,7 +2,7 @@
home: true
heroImage: /logo.png
actionText: Quick Started →
actionLink: /guide/
actionLink: /guide/quick-start
# features:
# - title: Simplicity First
# details: Minimal setup with markdown-centered project structure helps you focus on writing.
......
# Optimize
**There is currently no English document, I will finish it as soon as possible. You can refer to the Chinese document first.**
> If you are interested, you can help me improve the English documentation through [PR](https://github.com/liuyib/hexo-theme-stun/pulls), I will be very grateful.
# Primary Setting
**There is currently no English document, I will finish it as soon as possible. You can refer to the Chinese document first.**
> If you are interested, you can help me improve the English documentation through [PR](https://github.com/liuyib/hexo-theme-stun/pulls), I will be very grateful.
......@@ -10,12 +10,12 @@
$ git clone https://github.com/liuyib/hexo-theme-stun.git themes/stun
```
- Install `pug` and `stylus`
- Install dependency `pug`
The theme depends on `pug` and `stylus`, please run follow in your hexo directory.
Enter your hexo directory, run this.
``` bash
$ npm install --save hexo-render-pug hexo-renderer-stylus
$ npm install --save hexo-render-pug
```
## How to use
......
......@@ -2,7 +2,7 @@
home: true
heroImage: /logo.png
actionText: 快速开始 →
actionLink: /zh-CN/guide/
actionLink: /zh-CN/guide/quick-start
# features:
# - title: Simplicity First
# details: Minimal setup with markdown-centered project structure helps you focus on writing.
......
......@@ -383,7 +383,9 @@ sidebar:
# 侧边栏距离顶部的距离(只支持 px 单位)
offsetTop: 20px
# 是否显示水平分割线
horizon_line: true
horizon_line: false
# 侧边栏宽度(建议宽度:240px ~ 340px)
width: 280px
```
::: danger <Badge text="Deprecated" type="error"/>
......@@ -407,7 +409,7 @@ toc:
# 生成目录时,解析 h 标签的最大深度
# 你可以在文章的 markdown 源文件的 Front-Matter 中,通过添加 `toc_max_depth` 属性,
# 来指定某篇文章生成目录时,解析 h 标签的最大深度
max_depth: 6
max_depth: 4
```
其中 `expand_all` <Badge text="v1.0.2"/>。可以在文章的 markdown 源文件中的 `Front-Matter` 里,指定 `toc: true / false` 来设置某篇文章是否启用目录。
......@@ -661,35 +663,11 @@ code_word_wrap: false
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190608214539.png)
## 图片水平对齐方式 <Badge text="Stable"/>
## 图片水平对齐方式
设置文章中图片的水平对齐方式,修改主题配置文件:
``` yaml
img_horizonal_align:
```
可选的值有:`left`, `center`, `right`。默认值为空,即不设置。
> 默认情况下,图片显示居左,支持行内显示。如果你手动设置了图片的水平对齐方式,则图片不再支持行内显示。
效果分别如下:
- 设为默认值,即 `img_horizonal_align:` 设为空。
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190608220937.png)
- `img_horizonal_align: left`
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190608215836.png)
- `img_horizonal_align: center`
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190608215837.png)
- `img_horizonal_align: right`
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190608215838.png)
::: danger <Badge text="Deprecated" type="error"/>
该配置项,即 `img_horizonal_align``v1.4.0` 版本中移除。
:::
## 文字与图片的垂直对齐方式
......
......@@ -145,12 +145,46 @@ quicklink:
# - uri => uri.includes('.zip')
# - (uri, el) => el.hasAttribute('nofollow')
ignores:
- /\/api\/?/
- uri => uri.includes('.xml')
- uri => uri.includes('.zip')
- (uri, el) => el.hasAttribute('nofollow')
- (uri, el) => el.hasAttribute('noprefetch')
```
2. 添加 `Front-Matter`
上一步只是设置了 home 页面和 archive 页面是否启用 quicklink,对于其他页面或文章,你必须手动设置:在页面或文章的 markdown 文件的 `Front-Matter` 中,添加 `quicklink: true`
## 启用 Pjax <Badge text="Stable"/> <Badge text="v1.4.0"/>
启用 Pjax 可以让你的博客在页面之间跳转时,只进行局部刷新。这样不仅可以改善用户浏览体验,更能提高页面的加载速度。如果想启用这一功能,你需要修改主题配置文件:
``` yaml
pjax:
enable: true
# !!!如果你不了解 Pjax 的用法,请忽视下面的配置项
# 详参见: https://github.com/MoOx/pjax/#options
elements:
selectors:
switches:
switchesOptions:
history: true
scrollTo: false
scrollRestoration: false
cacheBust: false
debug: false
currentUrlFullReload: false
timeout: 0
```
::: warning 已知问题
下面是启用 Pjax 之后,已知的一些问题。
- 不兼容 MathJax(必须手动刷新页面一次后,MathJax 才能正常使用)
- 不兼容评论(评论显示为空,必须手动刷新页面才能显示出用户的评论)
:::
## 添加 Emoji 支持 <Badge text="Disrelated" type="warning"/>
如果想要使用 Emoji,你可以直接在[这里](http://emojihomepage.com/)复制粘贴使用。
......@@ -298,29 +332,22 @@ disqus:
busuanzi:
# 是否启用
enable: false
site:
# 是否只显示图标
icon_only: false
# 统计站点 UV 数量
# 关于 UV 和 PV 的概念:https://zhuanlan.zhihu.com/p/27672009/
uv:
# 是否启用
enable: true
# FontAwesome 图标名称: https://fontawesome.com/v4.7.0/icons/
icon: user
# 统计站点 PV 数量
pv:
# 是否启用
enable: true
# FontAwesome 图标名称
icon: eye
# 是否只显示图标
icon_only: false
# 统计站点 UV 数量
site_uv:
enable: true
# FontAwesome 图标名称: https://fontawesome.com/v4.7.0/icons/
icon: user
# 统计站点 PV 数量
site_pv:
enable: true
# FontAwesome 图标名称: https://fontawesome.com/v4.7.0/icons/
icon: eye
# 统计每篇文章的 PV 数量
post_pv:
# 是否只显示图标
icon_only: false
# 是否启用
enable: true
# FontAwesome 图标名称
# FontAwesome 图标名称: https://fontawesome.com/v4.7.0/icons/
icon: eye
```
......
......@@ -18,7 +18,7 @@
## 添加新页面 <Badge text="Stable"/>
Stun 主题内置了三种页面:分类页、标签页、关于页。默认没有启用。想启用这些页面,需要按照如下步骤操作:
Stun 主题内置有:分类页、标签页。默认没有启用。想启用这些页面,需要按照如下步骤操作:
1. 在 Hexo 根目录下执行命令
......@@ -28,12 +28,21 @@ $ hexo new page categories
# 启用标签页,执行这条指令
$ hexo new page tags
```
2. 修改 Front-Matter
找到 Hexo 根目录下的 `source/categories``source/tags` 文件夹中的 markdown 文件,添加 Front-Matter:
``` yaml
# 如果是分类页,添加这个
type: "categories"
# 启用关于页,执行这条指令
$ hexo new page about
# 如果是标签页,添加这个
type: "tags"
```
2. 然后修改主题配置文件,将 `categories``tags``about` 对应项取消注释
3. 然后修改主题配置文件,将 `categories``tags` 对应项取消注释
``` yaml
menu:
......@@ -43,11 +52,10 @@ menu:
archives: /archives/ || folder-open
# categories: /categories/ || th
# tags: /tags/ || tags
# about: /about/ || user
# xxx: /xxx/ || xxx
```
除了使用上述三种内置页面外,如果你想使用自定义页面,需要执行如下步骤:
除了使用上述内置页面外,如果你想使用自定义页面,需要执行如下步骤:
以添加**阅读**页面为例。
......@@ -62,7 +70,7 @@ menu:
> 图标的名称在这里获取:[https://fontawesome.com/v4.7.0/icons/](https://fontawesome.com/v4.7.0/icons/)。
1. 创建页面文件
2. 创建页面文件
在 Hexo 根目录下执行指令:
......
......@@ -10,12 +10,12 @@
$ git clone https://github.com/liuyib/hexo-theme-stun.git themes/stun
```
- 安装 pug 和 stylus
- 安装依赖 pug
主题依赖于 pug 和 stylus,请在 hexo 根目录,执行指令。
进入 hexo 根目录,执行指令。
``` bash
$ npm install --save hexo-render-pug hexo-renderer-stylus
$ npm install --save hexo-render-pug
```
## 使用
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册