From 96d21c2d18e2e4c4ad952ed2e14a0dd1800a8658 Mon Sep 17 00:00:00 2001 From: kitian616 Date: Sat, 7 Jul 2018 23:20:37 +0800 Subject: [PATCH] docs: update navigation --- docs/en/2.2-navigation.md | 31 ++++++++++++++++++++++++++++++- docs/zh/2.2-navigation.md | 31 ++++++++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 2 deletions(-) diff --git a/docs/en/2.2-navigation.md b/docs/en/2.2-navigation.md index 8f32f3f9fe6..b7f455230c2 100644 --- a/docs/en/2.2-navigation.md +++ b/docs/en/2.2-navigation.md @@ -34,4 +34,33 @@ header: url: /~https://github.com/kitian616/jekyll-TeXt-theme ``` -You can use `titles` for a multi-language name. \ No newline at end of file +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 +``` \ No newline at end of file diff --git a/docs/zh/2.2-navigation.md b/docs/zh/2.2-navigation.md index 950a50cc1a0..027659b317d 100644 --- a/docs/zh/2.2-navigation.md +++ b/docs/zh/2.2-navigation.md @@ -34,4 +34,33 @@ header: url: /~https://github.com/kitian616/jekyll-TeXt-theme ``` -你可以用 `titles` 来定义一个支持多语言的标题名。 \ No newline at end of file +你可以用 `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 +``` \ No newline at end of file