Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
neoFelhz committed Oct 5, 2017
1 parent b08f51a commit ebe44ac
Show file tree
Hide file tree
Showing 17 changed files with 50 additions and 83 deletions.
20 changes: 2 additions & 18 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@
在使用 「Material」主题之前,请仔细阅读 Hexo 的[官方文档](https://hexo.io/zh-cn/docs/index.html),完成对 Hexo 的安装和基本的配置。

>在本文档中,我们假定你已经成功安装了 Hexo,并根据 Hexo 的文档创建了一个站点,**并完成了基本的设置**
> 在本文档中,我们假定你已经成功安装了 Hexo,并根据 Hexo 的文档创建了一个站点,**并完成了基本的设置**
在 Hexo 中,通常有两份配置文件,一个是站点根目录下的 `_config.yml`;另外一个是主题目录下的 `_config.yml`
在 Hexo 中,通常有两份配置文件,一个是站点根目录下的 `_config.yaml`;另外一个是主题目录下的 `_config.yaml`
为了描述方便,在以下说明中,将前者称为 **站点配置文件**,后者称为 **主题配置文件**

----

「Material」主题文档包括以下部分:

- [开始使用](start)
- 主题配置
- [基本配置](config/basic)
- [样式设定](config/style)
- [自定义设定](config/customize)
- [菜单设定](config/menu)
- [第三方服务](config/services)
- [进阶使用](expert)
- [独立页面](pages)
- [开始创作](compose)
- [捐赠](donate)
2 changes: 1 addition & 1 deletion docs/config_basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

>例如:选用繁體中文,则配置为:
```yml
```yaml
language: zh-TW
```
Expand Down
8 changes: 4 additions & 4 deletions docs/config_customize.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
你可以在页面的 Footer 指定你想显示的文字,支持 HTML 标签;默认为空。
比如,备案号可以这样设定:

```yml
```yaml
footer_text: '<a href="http://www.miitbeian.gov.cn" rel="nofollow">某ICP备xxxxxxxx号-x</a>'
```
Expand All @@ -22,9 +22,9 @@ footer_text: '<a href="http://www.miitbeian.gov.cn" rel="nofollow">某ICP备xxxx
使用 `Google Prettify` 或 `hanabi` 实现代码高亮。你只能启用他们中的一个。
启用之前你需要禁用 Hexo 自带的代码高亮。

```yml
```yaml
# Available value for `prettify` or `hanabi`: true | false
# You can only enable one of them to avoid issues. Also you need to check highlight option in _config.yml. Make sure that default hexo built in highlight plugin is disabled.
# You can only enable one of them to avoid issues. Also you need to check highlight option in _config.yaml. Make sure that default hexo built in highlight plugin is disabled.
# highlight:
# enable: false
#
Expand Down Expand Up @@ -57,7 +57,7 @@ hanabi:
你可以在每篇文章的结尾添加你的版权说明,支持 HTML 标签。License 以粗体显示,默认为空。
比如,你可这样设定 CC License。

```yml
```yaml
license: 'This blog is under a <a href="/creativecommons.html" target="_blank">CC BY-NC-SA 3.0 Unported License</a>'
```
> 你也可以在页面的 Front-Matter 中为不同文章添加不同的 License。
Expand Down
6 changes: 3 additions & 3 deletions docs/config_services.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Material 主题提供了两种使用 [Disqus](https://disqus.com/) 主题的方

>例如:Disqus 域名 `example.disqus.com`
> ```yml
> ```yaml
shortname: example
```
Expand Down Expand Up @@ -86,7 +86,7 @@ Material 主题内置了 `google ` `swiftype` `local` 三种搜索系统。
使用本地搜索需要安装 [hexo-generator-search](https://github.com/PaicHyperionDev/hexo-generator-search) 插件。
然后在 `站点配置` 文件中添加
```yml
```yaml
search:
path: search.xml
field: all
Expand Down Expand Up @@ -122,7 +122,7 @@ search:
### 其它统计服务
确保 上述配置的字段为空,然后在在 `head.yml` 中填入你的统计服务代码。如何使用 `head.yml`,请访问[进阶设定](/expert/)中关于 自定义代码 的部分。
确保 上述配置的字段为空,然后在在 `head.yaml` 中填入你的统计服务代码。如何使用 `head.yaml`,请访问[进阶设定](/expert/)中关于 自定义代码 的部分。
### PV&UV 统计
Expand Down
2 changes: 1 addition & 1 deletion docs/config_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ footer_image:
> `fonts.family` 默认值为 `Roboto, "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif`
> 该字体设定为 Material Design 的规范,如无特殊要求 无需额外修改。
> 当你修改字体时,请在 `head.yml` 内使用 `<link>` 标签引用你的字体源。如何使用 `head.yml`,请访问[进阶设定](/expert/)中关于 自定义代码 的部分。
> 当你修改字体时,请在 `head.yaml` 内使用 `<link>` 标签引用你的字体源。如何使用 `head.yaml`,请访问[进阶设定](/expert/)中关于 自定义代码 的部分。
- `use`: 用于设置站点字体的引用方式。Material 主题内置了以下三种字体库支持。除此以外,你也可以手动设定你喜欢的谷歌字体反代服务。
- `google`: 使用 Google 字体库加载 `Roboto` 字体。
Expand Down
2 changes: 1 addition & 1 deletion docs/en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Before using "Material", please read the [Hexo documentions](https://hexo.io/doc

> In this docs, we suppose you just succefully installed the Hexo, and already configure your new site.
In Hexo, there are usually two configuration files, both called `_config.yml`. The first one is in the site root directory; the other is in the theme directory.
In Hexo, there are usually two configuration files, both called `_config.yaml`. The first one is in the site root directory; the other is in the theme directory.
For convenience of description, in the following description, the former is referred to as the **site config** and the latter as the **theme config**.

----
Expand Down
10 changes: 5 additions & 5 deletions docs/en/config_customize.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ When it is empty, the footer will only show the current year.
You can specify the text you want to show in footer, HTML tag is supported.
For example, you can setup ICP license number as:

```yml
```yaml
footer_text: '<a href="http://www.miitbeian.gov.cn" rel="nofollow">某ICP备xxxxxxxx号-x</a>'
```
Expand All @@ -29,11 +29,11 @@ Use this to show qrcode in your article.
## Code

Use `Google Prettify` or `hanabi` to highlight the code
if true, check highlight option in _config.yml. Make sure that default code highlight plugin is disabled.
if true, check highlight option in _config.yaml. Make sure that default code highlight plugin is disabled.

```yml
```yaml
# Available value for `prettify` or `hanabi`: true | false
# You can only enable one of them to avoid issues. Also you need to check highlight option in _config.yml. Make sure that default hexo built in highlight plugin is disabled.
# You can only enable one of them to avoid issues. Also you need to check highlight option in _config.yaml. Make sure that default hexo built in highlight plugin is disabled.
# highlight:
# enable: false
#
Expand Down Expand Up @@ -63,7 +63,7 @@ hanabi:
You can specify the text you want to show in the end of your posts and pages, HTML tag is supported.
For example, you can setup a CC license as:
```yml
```yaml
license: 'This blog is under a <a href="/creativecommons.html" target="_blank">CC BY-NC-SA 3.0 Unported License</a>'
```
> You can also use Front-Matter `license` to override this setting.
2 changes: 1 addition & 1 deletion docs/en/config_services.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Material theme has a built in Baidu's, Google's website analytics and CNZZ's ana

### Other Analytics

You should left the all the site_id empty below. Then you can add the analytics code in `head.yml`. You can read the [expert](/en/expert/) about how to use `head.yml`.
You should left the all the site_id empty below. Then you can add the analytics code in `head.yaml`. You can read the [expert](/en/expert/) about how to use `head.yaml`.

### Leancloud

Expand Down
2 changes: 1 addition & 1 deletion docs/en/config_style.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ footer_image:

> The default values are `Roboto, Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Microsoft Yahe, Arial`
> The font settings are more standardized for Material Design, no special requirements without additional changes.
> When update the fonts, you should add fonts embed in `head.yml`. You can read [expert](/en/expert/) about how to use `head.yml`
> When update the fonts, you should add fonts embed in `head.yaml`. You can read [expert](/en/expert/) about how to use `head.yaml`

- `use`: Used to set which fonts lib will be uesd in the theme.

Expand Down
8 changes: 4 additions & 4 deletions docs/en/expert.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

If you want to add custom code, like `font-face` or statistical code (such as `Piwik Analytics`) to your site, you need to create a folder named `_data` (no rename) in the `source` folder in your site directory.

Then create a file called `head.yml` in the file:
Then create a file called `head.yaml` in the file:

```yaml
Name:
Expand All @@ -13,7 +13,7 @@ Name:
The code will be displayed before `</head>` tag. `Name` will appear as a comment above the code.

Also, if you want to add custom code before `</html>` , simply create a file called `footer.yml` in `_data`. Same usage as `head.yml`
Also, if you want to add custom code before `</html>` , simply create a file called `footer.yaml` in `_data`. Same usage as `head.yaml`

## Material icons

Expand All @@ -22,8 +22,8 @@ The list of icon used to customized the dropdown or page buttons is available [h
## Code highlight

From `Version 1.3.0`, you can use `hexo-prism-plugin` to highlight your codes, visit [Hexo-Prism-Plugin Github](https://github.com/ele828/hexo-prism-plugin) to learn more.

From `Version 1.4.5`, Material built in the `Google Prettify` for code_highlight.
From `Version 1.5.0`, Material built in the `Hanibi` for code_highlight.

## Files Vendors

Expand All @@ -40,7 +40,7 @@ Here is an example of configuration.

```yaml
vendors:
materialcdn: https://materialcdn.nfz.moe/hexo/1.3.2
materialcdn: https://cdn.jsdelivr.net/gh/viosey/hexo-theme-material@latest/source
```
-----

Expand Down
10 changes: 5 additions & 5 deletions docs/en/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ Once you have the `themes/material` folder, open the **site config**, find the `

> The folder `themes/material` can be named differently if you wish. You simply have to adapt the `theme` field accordingly.
**The `_config.yml` file does not exist in the theme, you need to manually duplicate the `_config.template.yml` file and rename it to `_config.yml`**
**The `_config.yaml` file does not exist in the theme, you need to manually duplicate the `_config.template.yaml` file and rename it to `_config.yaml`**

Run `hexo s --debug` and go to [`http://localhost:4000`](http://localhost:4000) to make sure the site is running properly.

## Update "Material"

### Direct download

Save your `_config.yml` file somewhere. Then download a new [stable release](https://github.com/viosey/hexo-theme-material/releases) and extract the content inside the `themes/material` directory. Finally reconcile the new version of the `_config.yml` with the one you saved.
Save your `_config.yaml` file somewhere. Then download a new [stable release](https://github.com/viosey/hexo-theme-material/releases) and extract the content inside the `themes/material` directory. Finally reconcile the new version of the `_config.yaml` with the one you saved.

The previous commands will put aside your custom config, pull the update reapply your modifications. Fix conflicts if needed.

Expand All @@ -48,15 +48,15 @@ NPM updates can be done in two ways:

#### NPM update

Save your `_config.yml` file somewhere. Then use:
Save your `_config.yaml` file somewhere. Then use:

```bash
npm update hexo-material
rm -R themes/material
cp -R node_modules/hexo-material/ themes/material
```

Finally reconcile the new version of the `_config.yml` with the one you saved.
Finally reconcile the new version of the `_config.yaml` with the one you saved.

#### npm-check

Expand All @@ -68,7 +68,7 @@ Install npm-check:
npm install -g npm-check
```

Save your `_config.yml` file somewhere. Then use:
Save your `_config.yaml` file somewhere. Then use:

```bash
npm-check hexo-material
Expand Down
4 changes: 2 additions & 2 deletions docs/en/pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you want to add a link to the "Link" page, please refer to the [page settings

### Add data

Create a folder named `_data` (rename is forbidden) within the `source` folder. Then create a file named `links.yml` inside this folder.
Create a folder named `_data` (rename is forbidden) within the `source` folder. Then create a file named `links.yaml` inside this folder.

The format for a single link is:

Expand Down Expand Up @@ -53,7 +53,7 @@ If you'd like to add an entry to the "Gallery" page, please refer to the [page s

### Add data

Create a folder named `_data` (rename is forbidden) within the `source` folder. Then create a file named `gallery.yml` inside this folder.
Create a folder named `_data` (rename is forbidden) within the `source` folder. Then create a file named `gallery.yaml` inside this folder.

The format for a single image is:

Expand Down
13 changes: 2 additions & 11 deletions docs/en/start.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,21 @@

Installation of an Hexo theme is quite simple. You simply need to put the theme directory inside the `themes` directory of your site and modify the theme config.

### Github

You can get a [stable release](https://github.com/viosey/hexo-theme-material/releases) from Github in a timely manner.

### npm

```
npm install hexo-material
```
>This way the material theme will be downloaded to the `node_modules` folder under the hexo directory.
## Enable "Material"

Download a [stable release](https://github.com/viosey/hexo-theme-material/releases) and extract the content inside the `themes/material` directory.
Once you have the `themes/material` folder, open the **site config**, find the `theme` field, and change its value to `material`.

> The folder `themes/material` can be named differently if you wish. You simply have to adapt the `theme` field accordingly.
**The `_config.yml` file does not exist in the theme, you need to manually duplicate the `_config.template.yml` file and rename it to `_config.yml`**
**The `_config.yaml` file does not exist in the theme, you need to manually duplicate the `_config.template.yaml` file and rename it to `_config.yaml`**

Run `hexo s --debug` and go to [`http://localhost:4000`](http://localhost:4000) to make sure the site is running properly.

## Update "Material"

Save your `_config.yml` file somewhere. Then download a new [stable release](https://github.com/viosey/hexo-theme-material/releases) and extract the content inside the `themes/material` directory. Finally reconcile the new version of the `_config.yml` with the one you saved.
Save your `_config.yaml` file somewhere. Then download a new [stable release](https://github.com/viosey/hexo-theme-material/releases) and extract the content inside the `themes/material` directory. Finally reconcile the new version of the `_config.yaml` with the one you saved.

The previous commands will put aside your custom config, pull the update reapply your modifications. Fix conflicts if needed.
13 changes: 7 additions & 6 deletions docs/expert.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

如果想要在站点的 `<head>` 之前添加自定义 `font-face` 或者统计代码(例如 `Piwik Analytics`)。

需要在 hexo 目录下的 `source` 文件夹内创建一个名为 `_data`(禁止改名)的文件夹,并在文件内创建一个名为 head.yml 的文件。
需要在 hexo 目录下的 `source` 文件夹内创建一个名为 `_data`(禁止改名)的文件夹,并在文件内创建一个名为 `head.yaml` 的文件。

单个代码格式为:

```yml
```yaml
Name:
"put your code here"
```
Expand All @@ -21,17 +21,17 @@ Name:

---

如果想要在站点的 `</html>` 之前添加自定义代码(例如 `Service Worker`)。
如果想要在站点的 `</body>` 之前添加自定义代码(例如 `Service Worker`)。

需要在 hexo 目录下的 `source` 文件夹内创建一个名为 `_data`(禁止改名)的文件夹,并在文件内创建一个名为 footer.yml 的文件。
需要在 hexo 目录下的 `source` 文件夹内创建一个名为 `_data`(禁止改名)的文件夹,并在文件内创建一个名为 `footer.yaml` 的文件。
单个代码格式为:

```yml
```yaml
Name:
"put your code here"
```

代码将显示在 `</html>` 之前。
代码将显示在 `</body>` 之前。

## Material 图标

Expand All @@ -43,6 +43,7 @@ Name:

从 `1.3.0` 版本开始,您可以使用 `hexo-prism-plugin` 进行代码染色,具体文档请参阅 [Hexo-Prism-Plugin 插件文档](https://github.com/ele828/hexo-prism-plugin)
从 `1.4.5` 版本开始,您可以使用主题内置的 `Google Prettify` 进行代码染色。具体文档请参阅主题配置。
从 `1.5.0` 版本开始,您可以使用主题内置的 `Hanabi` 进行代码染色。具体文档请参阅主题配置。

## 使用 CDN

Expand Down
9 changes: 5 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<meta name="description" content="Material theme, an elegant & Material Design theme.">
<meta name="keywords" content="Hexo, hexo, theme, hexo theme, viosey, material theme, material design, material 主题">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<link rel="shortcut icon" href="https://github.elemecdn.com/neko-dev/material-theme-docs/1.5.3.1/static/favicon.ico" type="image/x-icon">
<link rel="icon" href="https://github.elemecdn.com/neko-dev/material-theme-docs/1.5.3.1/static/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="https://cdn.jsdelivr.net/gh/neko-dev/material-theme-docs@1.5.3.3/static/favicon.ico" type="image/x-icon">
<link rel="icon" href="https://cdn.jsdelivr.net/gh/neko-dev/material-theme-docs@1.5.3.3/static/favicon.ico" type="image/x-icon">
<title>Material Theme</title>
<meta property="og:url" content="https://material.viosey.com">
<meta property="og:type" content="website">
<meta property="og:title" content="Material Theme">
<meta property="og:description" content="Material theme, an elegant & Material Design theme.">
<link rel="stylesheet" href="https://github.elemecdn.com/neko-dev/material-theme-docs/1.5.3.1/static/css/style.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/neko-dev/material-theme-docs@1.5.3.3/static/css/style.min.css">
<link rel="stylesheet" href="https://fonts.geekzu.org/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600">
</head>

Expand Down Expand Up @@ -61,12 +61,13 @@
autoHeader: true,

// use jsdelivr load markdown file
basePath: 'https://cdn.jsdelivr.net/gh/neko-dev/material-theme-docs@1.5.3.3/docs/',
basePath: '/',

//Auto2Top
auto2top: true,
}
</script>

<script src="https://cdnjs.cat.net/ajax/libs/docsify/4.3.6/docsify.min.js"></script>
<script src="https://cdnjs.cat.net/ajax/libs/docsify/4.3.6/plugins/search.min.js"></script>
<script src="https://cdnjs.cat.net/ajax/libs/prism/1.8.1/components/prism-yaml.min.js"></script>
Expand Down
8 changes: 4 additions & 4 deletions docs/pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ layout: links
### 添加数据
同样在在 hexo 目录下的 `source` 文件夹内创建一个名为 `_data`(禁止改名)的文件夹。

然后在文件内创建一个名为 `links.yml` 的文件。
然后在文件内创建一个名为 `links.yaml` 的文件。

单个友情链接的格式为:

```yml
```yaml
Name:
link: http://example.com
avatar: http://example.com/avatar.png
Expand Down Expand Up @@ -63,11 +63,11 @@ layout: gallery
### 添加数据
同样在在 hexo 目录下的 `source` 文件夹内创建一个名为 `_data`(禁止改名)的文件夹。

然后在文件内创建一个名为 `gallery.yml` 的文件。
然后在文件内创建一个名为 `gallery.yaml` 的文件。

单个图片的格式为:

```yml
```yaml
Name:
full_link: http://example.com/full-image.png
thumb_link: http://example.com/thumb-image.png
Expand Down
Loading

0 comments on commit ebe44ac

Please sign in to comment.