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

docs: Update docs

上级 ebe85207
......@@ -2,7 +2,7 @@
## 快捷键
### 快速切换文章 <Badge text="beta" type="warn"/> <Badge text="v1.1.3"/>
### 快速切换文章 <Badge text="Beta" type="warn"/> <Badge text="v1.1.3"/>
::: tip
该功能在 `v1.1.0` 版本中快捷键为(`←`:切换到上一篇文章,`→`:切换到下一篇文章),在 `v1.1.3` 版本中快捷键修改为(Ctrl + `←`,Ctrl + `→`)。
......@@ -24,7 +24,7 @@ shortcuts:
> 考虑到这里的快捷键可能会和用户系统或软件的冲突,所以在 Stun 主题 `v1.1.3` 版本中,这个功能加入了配置项,用户可以自己决定是否开启,默认不启用。并且在 Stun 主题以后的版本中,可能会留出配置项让用户自定义快捷键。
### 快速关闭搜索框 <Badge text="stable"/> <Badge text="v1.0.3"/>
### 快速关闭搜索框 <Badge text="Stable"/> <Badge text="v1.0.3"/>
关闭搜索框有三种方式,1. 点击关闭按钮,2. 点击蒙版,3. 按下 `Esc` 键。
......@@ -36,7 +36,7 @@ Hexo 主题一般都会扩展一些自己特有的标签插件,在这方面做
此外,Stun 主题也有自己扩展的一些标签插件,这些标签插件如下:
### 插入表格数据 <Badge text="beta" type="warning"/> <Badge text="v1.2.0"/>
### 插入表格数据 <Badge text="Stable"/> <Badge text="v1.2.0"/>
如果想要在文章中显示一个表格,你可以使用 markdown 原生支持的语法,但是如果你想要让表格里的数据存储在外部文件中,那么你可以使用下面这种语法:
......@@ -87,7 +87,7 @@ Hexo 主题一般都会扩展一些自己特有的标签插件,在这方面做
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190803141118.png)
### Bootstrap 标注 <Badge text="beta" type="warning"/> <Badge text="v1.2.0"/>
### Bootstrap 标注 <Badge text="Stable"/> <Badge text="v1.2.0"/>
语法如下:
......@@ -141,7 +141,7 @@ This is success note.
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190803081736.png)
### 友链 <Badge text="beta" type="warning"/> <Badge text="v1.2.0"/>
### 友链 <Badge text="Stable"/> <Badge text="v1.2.0"/>
语法如下:
......
# 优化建议
## 打包、压缩资源文件 <Badge text="disrelated" type="warning"/>
## 打包、压缩资源文件 <Badge text="Disrelated" type="warning"/>
Stun 主题的源码中,`HTML`, `CSS`, `JavaScript`, `图片` 等资源文件是没有打包压缩的。**绝大部分的 Hexo 主题也是如此**。庆幸的是 Hexo 提供了相关的插件,来帮助用户解决这一问题。
......
......@@ -46,7 +46,7 @@ language: zh-CN # 可选值 zh-CN 或 en-US
Stun 主题内置了三种页面:分类页、标签页、关于页。想启用这些页面,需要按照如下步骤操作:
1. 在 Hexo 根目录下执行命令
1. 在 Hexo 根目录下执行命令
``` bash
# 启用分类页,执行这条指令
......@@ -59,7 +59,7 @@ $ hexo new page tags
$ hexo new page about
```
2. 然后修改主题配置文件,将对应的项取消注释
2. 然后修改主题配置文件,将对应的项取消注释
``` yaml
menu:
......@@ -75,7 +75,7 @@ menu:
以添加**阅读**页面为例。
1. 修改主题配置文件,添加相应的菜单项
1. 修改主题配置文件,添加相应的菜单项
``` yaml
menu:
......@@ -88,7 +88,7 @@ menu:
>
> 如果只添加路径,没有添加图标名称,会使用默认图标进行显示。
2. 创建页面文件
2. 创建页面文件
在 Hexo 根目录下执行指令:
......@@ -96,7 +96,7 @@ menu:
$ hexo new page reading
```
3. 国际化设置
3. 国际化设置
找到 `languages` 目录下的语言文件进行修改:
......@@ -264,6 +264,10 @@ gallery_waterfall:
用于设置文章中,解析标题生成目录的最大深度。取值 `1 ~ 6`。例如:`toc_max_depth: 3`,只会解析文中的 `h1`, `h2`, `h3` 来生成目录。详情:[文章目录](https://liuyib.github.io/hexo-theme-stun/zh-CN/advanced/theme-config.html#文章目录)
- `quicklink: true` <Badge text="Stable"/> <Badge text="v1.2.3"/>
是否在浏览器空闲时间预取可视区内的链接,以加快后续页面的加载速度。详情:[](https://liuyib.github.io/hexo-theme-stun/zh-CN/advanced/theme-config.html#)
- `math: true` <Badge text="Stable"/> <Badge text="v1.1.2"/>
是否需要解析数学公式。详情:[数学公式](https://liuyib.github.io/hexo-theme-stun/zh-CN/advanced/third-part.html#数学公式)
......@@ -302,7 +306,7 @@ gallery_waterfall:
favicon:
small: /images/icons/favicon-16x16.png
medium: /images/icons/favicon-32x32.png
# 如果你不懂,请忽略下面这些
# !!如果你不懂,请忽略下面这些!!
# apple_touch_icon: /images/icons/apple-touch-icon.png
# safari_pinned_tab: /images/icons/logo-stun.svg
# msapplication: /images/icons/favicon-144x144.png
......@@ -370,7 +374,7 @@ creative_commons:
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190619210339.png)
## 返回顶部 <Badge text="Beta" type="warn"/>
## 返回顶部 <Badge text="Stable"/>
修改主题配置文件:
......@@ -454,7 +458,7 @@ footer:
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190623192514.png)
## 侧边栏设置 <Badge text="Beta" type="warn"/>
## 侧边栏设置 <Badge text="Stable"/>
修改主题配置文件:
......@@ -510,14 +514,14 @@ author:
social:
github: https://github.com/ || github
google: https://plus.google.com/ || google
twitter: https://twitter.com/ || twitter
youtube: https://youtube.com/ || youtube
segmentfault: https://segmentfault.com/ || origin:sf
zhihu: https://www.zhihu.com/ || origin:知
weibo: https://weibo.com/ || weibo
wechat: yournumber || weixin
telegram: yournumber || telegram
qq: yournumber || qq
# twitter: https://twitter.com/ || twitter
# youtube: https://youtube.com/ || youtube
# segmentfault: https://segmentfault.com/ || origin:sf
# weibo: https://weibo.com/ || weibo
# zhihu: https://www.zhihu.com/ || origin:知
# wechat: yournumber || weixin
# telegram: yournumber || telegram
# qq: yournumber || qq
# 你可以自行添加这里没有的社交链接,格式如下:
# xxx: xxx || (origin:)xxx
......@@ -535,7 +539,7 @@ social_setting:
当你添加一个默认没有的社交链接时,你需要进行国际化设置。这里以添加链接 `掘金` 为例,步骤如下:
1. 修改主题配置文件
1. 修改主题配置文件
```yaml
social:
......@@ -544,7 +548,7 @@ social:
> 由于 Font Awesome 中找不到掘金的 logo,所以这里使用 `掘` 字来代替显示。
2. 国际化设置
2. 国际化设置
修改 `themes/stun/languages` 目录下的文件。
......@@ -855,7 +859,7 @@ code_word_wrap: false
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190608214539.png)
## 图片水平对齐方式 <Badge text="Beta" type="warn"/>
## 图片水平对齐方式 <Badge text="Stable"/>
设置文章中图片的水平对齐方式,修改主题配置文件:
......@@ -910,7 +914,7 @@ reward:
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190608175556.png)
## 标签云 <Badge text="Beta" type="warn"/>
## 标签云 <Badge text="Stable"/>
如果你启用了 `tags` 页面,想要对其进行设置,修改主题配置文件:
......@@ -964,7 +968,7 @@ external_link:
color: '#aaa'
```
### FancyBox <Badge text="stable"/> <Badge text="v1.1.4"/>
### FancyBox <Badge text="Stable"/> <Badge text="v1.1.4"/>
如果想要使用 fancybox 功能,只需要修改主题配置文件即可:
......@@ -994,7 +998,7 @@ zoom_image:
如果你启用了 fancybox,那么主题会优先使用 fancybox 效果。
:::
### 图片懒加载 <Badge text="beta" type="warning"/> <Badge text="v1.2.0"/>
### 图片懒加载 <Badge text="Stable"/> <Badge text="v1.2.0"/>
从 `v1.2.0` 版本开始,Stun 主题开始支持图片懒加载,但是**该功能只对文章页面起作用**。你可以配置该功能,修改主题配置文件:
......
......@@ -9,13 +9,13 @@
使用步骤如下:
1安装插件
1. 安装插件
```bash
$ npm install --save hexo-pwa
```
2配置插件
2. 配置插件
找到 Hexo 根目录下的 `_config.yml` 文件,添加以下字段:
......@@ -53,7 +53,7 @@ pwa:
有关插件的详尽信息,请查看插件的[文档](https://github.com/lavas-project/hexo-pwa)
3修改主题配置
3. 修改主题配置
修改主题配置文件:
......@@ -65,7 +65,7 @@ pwa:
theme_color: "#54bcff"
```
4创建 `manifest.json` 文件
4. 创建 `manifest.json` 文件
你可以通过 [Web App Manifest](https://app-manifest.firebaseapp.com/) 网站来快速生成 `manifest.json` 文件。`manifest.json` 文件的内容如下:
......@@ -109,17 +109,53 @@ pwa:
}
```
5重启 Hexo 服务器
5. 重启 Hexo 服务器
```bash
$ hexo clean && hexo s
```
## 添加 Emoji 支持 <Badge text="disrelated" type="warning"/>
## 启用 Quicklink <Badge text="Stable"/> <Badge text="v1.2.3"/>
如果想要使用 [quicklink](https://github.com/GoogleChromeLabs/quicklink/),使浏览器在空闲时间预取可视区内的链接,以加快后续页面的加载速度。你需要按照如下步骤设置:
1. 修改主题配置文件
``` yaml
quicklink:
# 是否启用。这里启用之后并不会对所有页面生效,你还需要进行下面的设置
enable: true
# 设置 home 页面和 archive 页面是否启用
home: true
archive: true
# 当浏览器 load 事件触发后,开始初始化 quicklink
delay: true
# 自定义一个时间,必须进行预取。这里默认 10s
timeout: 10000
# 启用 fetch() 或回退到 XHR
priority: true
# 设置忽略预取的链接类型
# !!如果你不懂,请忽略这一项!!
# 例如:
# ignores:
# - /\/api\/?/
# - uri => uri.includes('.zip')
# - (uri, el) => el.hasAttribute('nofollow')
ignores:
```
2. 添加 `Front-Matter`
上一步只是设置了 home 页面和 archive 页面是否启用 quicklink,对于其他页面或文章,你必须手动设置:在页面或文章的 markdown 文件的 `Front-Matter` 中,添加 `quicklink: true`
## 添加 Emoji 支持 <Badge text="Disrelated" type="warning"/>
如果想要使用 Emoji,你可以直接在[这里](http://emojihomepage.com/)复制粘贴使用。
如果你更喜欢使用 Emoji 代码,例如:`:sparkles:` 将会显示为 :sparkles:, 那么你需要安装插件 [hexo-filter-github-emojis](https://github.com/crimx/hexo-filter-github-emojis) 来支持这种语法。
如果你更喜欢使用 Emoji 代码,例如:`:sparkles:` 解析为 :sparkles:, 那么你需要安装插件 [hexo-filter-github-emojis](https://github.com/crimx/hexo-filter-github-emojis) 来支持这种语法。
使用步骤如下:
......@@ -158,7 +194,7 @@ no-emoji: true
## 评论系统
### Gitment <Badge text="stable"/>
### Gitment <Badge text="Stable"/>
首先,你需要注册一个新的 **GitHub Application** 来授权,点击[这里](https://github.com/settings/applications/new)注册。这样可以获取所需的 `client ID` 和 `client secret`。
......@@ -186,7 +222,7 @@ gitment:
如果你遇到了问题,请查看 Gitment 的文档:[https://github.com/imsun/gitment](https://github.com/imsun/gitment)
### Gitalk <Badge text="stable"/> <Badge text="v1.1.0"/>
### Gitalk <Badge text="Stable"/> <Badge text="v1.1.0"/>
首先,你需要注册一个新的 **GitHub Application** 来授权,点击[这里](https://github.com/settings/applications/new)注册。这样可以获取所需的 `client ID` 和 `client secret`。
......@@ -217,7 +253,7 @@ gitalk:
如果你遇到了问题,请查看 Gitalk 的文档:[https://github.com/gitalk/gitalk](https://github.com/gitalk/gitalk)
### Valine <Badge text="stable"/> <Badge text="v1.1.1"/>
### Valine <Badge text="Stable"/> <Badge text="v1.1.1"/>
Valine 评论系统依赖于 LeanCloud,所以你需要[登录](https://leancloud.cn/dashboard/login.html#/signin)或[注册](https://leancloud.cn/dashboard/login.html#/signup) LeanCloud,获取 `APP ID` 和 `APP Key`。详细步骤,请查看:[https://valine.js.org/quickstart.html](https://valine.js.org/quickstart.html)
......@@ -250,7 +286,7 @@ valine:
完成上述步骤之后,你还需要在 LeanCloud 中新建 或 选择一个名为 `Comment` 的 Class 才能使用 Valine。详细步骤,请查看:[https://valine.js.org/quickstart.html#评论数据管理](https://valine.js.org/quickstart.html#评论数据管理)
### Livere(来必力)<Badge text="stable"/> <Badge text="v1.1.1"/>
### Livere(来必力)<Badge text="Stable"/> <Badge text="v1.1.1"/>
进入来必力[官网](https://livere.com/)注册账号,登录,点击安装,选择合适的版本后,会显示安装代码,在代码中可以找到你的 `uid`,例如:
......@@ -266,7 +302,7 @@ livere:
uid:
```
### Disqus <Badge text="stable"/> <Badge text="v1.1.1"/>
### Disqus <Badge text="Stable"/> <Badge text="v1.1.1"/>
进入 Disqus [官网](https://disqus.com/)注册账号,登录,点击 `I want to install Disqus on my site`,在 `Website Name` 字段中,输入你的网站的名称(可以是任意的),然后选择好 `Category` 和 `Language` 字段后,点击 `Create Site`。
......@@ -282,7 +318,7 @@ disqus:
## 统计与分析
### 卜蒜子统计 <Badge text="stable"/>
### 卜蒜子统计 <Badge text="Stable"/>
修改主题配置文件:
......@@ -318,7 +354,7 @@ busuanzi:
## 搜索系统
### Algolia 搜索 <Badge text="stable"/> <Badge text="v1.0.3"/>
### Algolia 搜索 <Badge text="Stable"/> <Badge text="v1.0.3"/>
如果你想使用 Algolia 搜索的话,并不会像其他配置那样,修改一下配置项就好了。你需要按照以下步骤进行配置:
......@@ -490,7 +526,7 @@ math:
MathJax 与 KaTex 相比之下,[KaTex 引擎速度更快](https://www.intmath.com/cg5/katex-mathjax-comparison.php),但 [KaTex 支持的语法更少](https://github.com/KaTeX/KaTeX/wiki/Things-that-KaTeX-does-not-%28yet%29-support),这里是 [KaTex 所支持的所有语法](https://katex.org/docs/supported.html)。
:::
### MathJax <Badge text="stable"/> <Badge text="v1.1.2"/>
### MathJax <Badge text="Stable"/> <Badge text="v1.1.2"/>
使用 mathjax 作为引擎,首先,你需要更换一个支持 MathJax 的 markdown 渲染器:
......@@ -523,7 +559,7 @@ math:
$ hexo clean && hexo s
```
### KaTex <Badge text="stable"/> <Badge text="v1.1.2"/>
### KaTex <Badge text="Stable"/> <Badge text="v1.1.2"/>
使用 katex 作为引擎,不需要引入 `katex.min.js`。相应的,你只需要更换一个支持 KaTex 的 markdown 渲染器。
......@@ -605,11 +641,11 @@ markdown:
Stun 主题默认提供了一些 MathJax 和 Katex 的插件。
- mhchem <Badge text="stable"/> <Badge text="v1.1.2"/>
- mhchem <Badge text="Stable"/> <Badge text="v1.1.2"/>
mhchem 是 MathJax 的插件,你可以使用这个插件来渲染化学方程式。详情请看:[MathJax/mhchem Manual](https://mhchem.github.io/MathJax-mhchem/)。
- Copy-tex <Badge text="stable"/> <Badge text="v1.1.2"/>
- Copy-tex <Badge text="Stable"/> <Badge text="v1.1.2"/>
Copy-tex 是 KaTex 的插件,当启用这个插件之后,你只需要单击公式即可复制其源码。详情请看:[Copy-tex extension](https://github.com/KaTeX/KaTeX/tree/master/contrib/copy-tex)。
......@@ -627,7 +663,7 @@ Copy-tex 是 KaTex 的插件,当启用这个插件之后,你只需要单击
## 广告
### 谷歌广告
### 谷歌广告 <Badge text="Stable"/> <Badge text="v1.1.4"/>
首先登录谷歌广告[官网](https://www.google.com/adsense),选择添加广告,在给你的一段代码中找到 `client_id`,通常以 `ca-pub-` 开头。然后修改主题配置文件:
......@@ -644,7 +680,7 @@ google_adsense:
## 特效
### Ribbon
### Ribbon <Badge text="Stable"/> <Badge text="v1.1.2"/>
修改主题配置文件:
......@@ -664,7 +700,7 @@ canvas_ribbon:
![](https://raw.githubusercontent.com/liuyib/picBed/master/hexo-theme-stun/doc/20190725220144.png)
### Particle / Nest
### Particle / Nest <Badge text="Stable"/> <Badge text="v1.1.2"/>
修改主题配置文件:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册