Skip to content

Commit

Permalink
[Feat] site, add param to hide pages
Browse files Browse the repository at this point in the history
  • Loading branch information
MattDodsonEnglish committed Jul 16, 2024
1 parent 2bcaf9c commit c6f1071
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Each page has the following frontmatter:
- `weight`: The page's relative position in the menu. Heavier weights "sink" to lower on the page.
- `categories`: (Optional) Meta-data about the topic
- `aliases`: URIs from old pages. Configure redirects here.
- `hidden`: If `true` page does not display in sidebar. Works only on leaf pages.
- `menu.main`: An object that configures the sidebar main menu properties
- `name`: (Optional) The title of the page as it appears in the sidebar. Default is `title`
- `identifier`: How to reference the page in menu configs, and relrefs and other shortcodes
Expand Down
6 changes: 5 additions & 1 deletion themes/hugo-docs/layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@
<ul class="sub-topics">
{{ range .Children }}
<li class="topic sub-topic{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}">
{{ if not .Page.Params.Hidden }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
</li>
{{ end }}
</ul>
{{ else }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ if not .Page.Params.Hidden }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
{{ end }}
</li>
{{ end }}
Expand Down

0 comments on commit c6f1071

Please sign in to comment.