feat: add multi level section menu
This commit is contained in:
parent
40a8705ab6
commit
4f9365181d
|
@ -10,6 +10,12 @@
|
|||
identifier = "help"
|
||||
url = "/docs/help/"
|
||||
|
||||
[[docs]]
|
||||
name = "Lorem"
|
||||
weight = 70
|
||||
identifier = "lorem"
|
||||
url = "/docs/lorem/"
|
||||
|
||||
[[main]]
|
||||
name = "Docs"
|
||||
url = "/docs/prologue/introduction/"
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
title: "Lorem"
|
||||
description: ""
|
||||
lead: ""
|
||||
date: 2022-01-18T19:58:14+01:00
|
||||
lastmod: 2022-01-18T19:58:14+01:00
|
||||
draft: false
|
||||
images: []
|
||||
toc: true
|
||||
---
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
title: "Ipsum"
|
||||
description: ""
|
||||
lead: ""
|
||||
date: 2022-01-18T20:00:32+01:00
|
||||
lastmod: 2022-01-18T20:00:32+01:00
|
||||
draft: false
|
||||
images: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "lorem"
|
||||
identifier: "ipsum"
|
||||
weight: 999
|
||||
toc: true
|
||||
---
|
|
@ -0,0 +1,15 @@
|
|||
---
|
||||
title: "Amet"
|
||||
description: ""
|
||||
lead: ""
|
||||
date: 2022-01-18T20:07:56+01:00
|
||||
lastmod: 2022-01-18T20:07:56+01:00
|
||||
draft: false
|
||||
images: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "ipsum"
|
||||
identifier: "amet"
|
||||
weight: 999
|
||||
toc: true
|
||||
---
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
title: "Consectetur"
|
||||
description: ""
|
||||
lead: ""
|
||||
date: 2022-01-18T20:17:32+01:00
|
||||
lastmod: 2022-01-18T20:17:32+01:00
|
||||
draft: false
|
||||
images: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "amet"
|
||||
weight: 730
|
||||
toc: true
|
||||
---
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
title: "Dolor"
|
||||
description: ""
|
||||
lead: ""
|
||||
date: 2022-01-18T20:01:45+01:00
|
||||
lastmod: 2022-01-18T20:01:45+01:00
|
||||
draft: false
|
||||
images: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "ipsum"
|
||||
weight: 700
|
||||
toc: true
|
||||
---
|
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
title: "Sit"
|
||||
description: ""
|
||||
lead: ""
|
||||
date: 2022-01-18T20:05:19+01:00
|
||||
lastmod: 2022-01-18T20:05:19+01:00
|
||||
draft: false
|
||||
images: []
|
||||
menu:
|
||||
docs:
|
||||
parent: "ipsum"
|
||||
weight: 710
|
||||
toc: true
|
||||
---
|
|
@ -1,3 +1,81 @@
|
|||
<aside>
|
||||
<ul class="list-unstyled collapsible-sidebar">
|
||||
{{ $currentPage := . }}
|
||||
{{ range .Site.Menus.docs }}
|
||||
{{ if .HasChildren }}
|
||||
<li class="{{ if $currentPage.HasMenuCurrent "docs" . }}active{{ end }}">
|
||||
<a href="#">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<ul class="sub-menu">
|
||||
{{ range .Children }}
|
||||
|
||||
|
||||
{{ if .HasChildren }}
|
||||
<li class="{{ if $currentPage.HasMenuCurrent "docs" . }}active{{ end }}">
|
||||
<a href="#">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<ul class="sub-menu">
|
||||
{{ range .Children }}
|
||||
|
||||
|
||||
{{ if .HasChildren }}
|
||||
<li class="{{ if $currentPage.HasMenuCurrent "docs" . }}active{{ end }}">
|
||||
<a href="#">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<ul class="sub-menu">
|
||||
{{ range .Children }}
|
||||
<li class="{{ if $currentPage.IsMenuCurrent "docs" . }}active{{ end }}">
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a href="{{ .URL }}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a href="{{ .URL }}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
|
||||
|
||||
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a href="{{ .URL }}">
|
||||
{{ .Pre }}
|
||||
<span>{{ .Name }}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
<!--
|
||||
{{ if .Site.Params.options.collapsibleSidebar -}}
|
||||
<ul class="list-unstyled collapsible-sidebar">
|
||||
{{ $currentPage := . -}}
|
||||
|
@ -37,3 +115,4 @@
|
|||
{{ end -}}
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
-->
|
||||
|
|
Loading…
Reference in New Issue