From f951fd9df646464365f45a7a0d73f10bd4791a50 Mon Sep 17 00:00:00 2001 From: Michael Wagner Date: Sat, 22 Jul 2017 20:44:35 +0200 Subject: [PATCH] Fixes nav ordering. Items with weight 0 got pushed to the bottom. Start nav menu items with weight 1. --- exampleSite/config.toml | 2 +- exampleSite/content/getting-started/index.md | 7 ++++--- exampleSite/content/index.md | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 85c6352..aff4b2f 100755 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -48,7 +48,7 @@ googleAnalytics = "" [[menu.main]] name = "Material" url = "/" - weight = 0 + weight = 1 [[menu.main]] name = "Getting started" diff --git a/exampleSite/content/getting-started/index.md b/exampleSite/content/getting-started/index.md index e501c04..3dc6650 100644 --- a/exampleSite/content/getting-started/index.md +++ b/exampleSite/content/getting-started/index.md @@ -205,11 +205,12 @@ Once you created your first content files you can link them manually in the side [[menu.main]] name = "Material" url = "/" - weight = 0 + weight = 1 pre = "" ``` -`name` is the title displayed in the menu and `url` the relative URL to the content. The `weight` attribute allows you to modify the order of the menu entries. A menu entry appears further down the more weight you add. The `pre` attribute is optional and allows you to *pre*pend elements to a menu link, e.g. an icon. +`name` is the title displayed in the menu and `url` the relative URL to the content. The `weight` attribute allows you to modify the order of the menu entries. A menu entry appears further down the + more weight you add. Weight should be at least 1. The `pre` attribute is optional and allows you to *pre*pend elements to a menu link, e.g. an icon. Instead of just linking a single file you can enhance the sidebar by creating a nested menu. This way you can list all pages of a section instead of linking them one by one (without nesting). @@ -220,7 +221,7 @@ menu: main: parent: Material identifier: - weight: 0 + weight: 1 ``` `main` specifies to which menu the content file should be added. `main` is the only menu in this theme by default. `parent` let's you register this content file to an existing menu entry, in this case the `Material` link. Note that the parent in the frontmatter needs to match the name in `config.toml`. diff --git a/exampleSite/content/index.md b/exampleSite/content/index.md index a48262e..3600825 100644 --- a/exampleSite/content/index.md +++ b/exampleSite/content/index.md @@ -2,7 +2,7 @@ date: 2016-03-08T21:07:13+01:00 title: Material for Hugo type: index -weight: 0 +weight: 1 --- ## Beautiful documentation