Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

Commit fb1645b

Browse files
Philippe Lafoucrièredigitalcraftsman
authored andcommitted
Fix navigation when using sections
closes #17
1 parent 6735124 commit fb1645b

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

layouts/partials/nav.html

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,15 @@
55
{{ $.Scratch.Set "currentMenuEntry" . }}
66
<li>
77
{{ if .HasChildren }}
8-
<li>
9-
{{ $currentURL := .URL }}
10-
11-
{{ range $.Site.Pages }}
12-
{{ if eq (printf "%s%s" $.Site.BaseURL $currentURL) ( printf "%s" .Permalink) }}
13-
<span class="section">{{ .Section | title }}</span>
14-
{{ end }}
15-
{{ end }}
16-
17-
8+
<span class="section">{{ .Name | title }}</span>
189
<ul>
1910
{{ range .Children }}
2011
{{ $.Scratch.Set "currentMenuEntry" . }}
21-
{{ partial "nav_link" $currentNode }}
12+
{{ partial "nav_link" $currentNode }}
2213
{{ end }}
2314
</ul>
24-
</li>
2515
{{ else }}
26-
{{ partial "nav_link" $currentNode }}
16+
{{ partial "nav_link" $currentNode }}
2717
{{ end }}
2818
</li>
29-
{{ end }}
19+
{{ end }}

0 commit comments

Comments
 (0)