Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Fixes nav ordering #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exampleSite/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ googleAnalytics = ""
[[menu.main]]
name = "Material"
url = "/"
weight = 0
weight = 1

[[menu.main]]
name = "Getting started"
Expand Down
7 changes: 4 additions & 3 deletions exampleSite/content/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand All @@ -220,7 +221,7 @@ menu:
main:
parent: Material
identifier: <link name>
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`.
Expand Down
2 changes: 1 addition & 1 deletion exampleSite/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
date: 2016-03-08T21:07:13+01:00
title: Material for Hugo
type: index
weight: 0
weight: 1
---

## Beautiful documentation
Expand Down