Skip to content

Commit

Permalink
docs: update navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
kitian616 committed Jul 7, 2018
1 parent 79bd285 commit 96d21c2
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
31 changes: 30 additions & 1 deletion docs/en/2.2-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,33 @@ header:
url: https://github.com/kitian616/jekyll-TeXt-theme
```
You can use `titles` for a multi-language name.
You can use `titles` for a multi-language name.

## Sidebar Navigation

To use sidebar navigation, you should first defined a navigation iin *data/navigation.yml*.

```yaml
docs-en:
- title: Start
children:
- title: Quick Start
url: /docs/en/quick-start
- title: Structure
url: /docs/en/structure
...
- title: Customization
children:
- title: Configuration
url: /docs/en/configuration
- title: Navigation
url: /docs/en/navigation
...
```

And then use the defined navigation as article's sidebar navigation in the Front Matter:

```yaml
sidebar:
nav: docs-en
```
31 changes: 30 additions & 1 deletion docs/zh/2.2-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,33 @@ header:
url: https://github.com/kitian616/jekyll-TeXt-theme
```
你可以用 `titles` 来定义一个支持多语言的标题名。
你可以用 `titles` 来定义一个支持多语言的标题名。

## 侧边栏导航栏

要想在某篇文章或页面中使用侧边栏导航栏,首先你需要在 *data/navigation.yml* 中定义一个导航栏。

```yaml
docs-en:
- title: Start
children:
- title: Quick Start
url: /docs/en/quick-start
- title: Structure
url: /docs/en/structure
...
- title: Customization
children:
- title: Configuration
url: /docs/en/configuration
- title: Navigation
url: /docs/en/navigation
...
```

然后在头信息中将定义的导航作为这篇文章或页面的侧边栏导航栏:

```yaml
sidebar:
nav: docs-en
```

0 comments on commit 96d21c2

Please sign in to comment.