File tree 2 files changed +9
-66
lines changed
2 files changed +9
-66
lines changed Original file line number Diff line number Diff line change 48
48
{{ if and (not .Params.chapter) (.Params.toc) }}
49
49
< span id ="toc-menu "> < a href =""> < i class ="fa fa-list-alt "> </ i > </ a > </ span >
50
50
{{ end }}
51
- {{ if $page.Site.Params.createFromSiteMenusMain}}
52
- {{ $type := .Params.menu.main.parent }}
53
- {{ $relLink := .RelPermalink }}
54
- {{ range $name , $value := .Site.Menus.main }}
55
-
56
- {{ if eq $value.Identifier $type }}
57
- {{ if ne $relLink $value.URL }}
58
- < a href ="{{ $value.URL }} " itemprop ="url "> < span itemprop ="title "> < b > {{ $value.Name }}</ b > </ span > </ a > < i class ="fa fa-angle-right "> </ i >
59
- {{ end }}
60
- {{ end }}
51
+ {{ $type := .Type }}
52
+ {{ $relLink := .RelPermalink }}
53
+ {{ range $name , $value := .Site.Sections }}
54
+ {{ if eq $name $type }}
55
+ {{ $first := (index $value 0).Page }}
56
+ {{ if ne $first.RelPermalink $relLink }}
57
+ < a href ="{{ $first.RelPermalink }} " itemprop ="url "> < span itemprop ="title "> {{ $first.Title }}</ span > </ a > < i class ="fa fa-angle-right "> </ i >
61
58
{{ end }}
62
-
63
- {{else}} <!-- use current method as default-->
64
-
65
- {{ $type := .Type }}
66
- {{ $relLink := .RelPermalink }}
67
- {{ range $name , $value := .Site.Sections }}
68
- {{ if eq $name $type }}
69
- {{ $first := (index $value 0).Page }}
70
- {{ if ne $first.RelPermalink $relLink }}
71
- < a href ="{{ $first.RelPermalink }} " itemprop ="url "> < span itemprop ="title "> {{ $first.Title }}</ span > </ a > < i class ="fa fa-angle-right "> </ i >
72
- {{ end }}
73
- {{ end }}
74
- {{ end }}
75
- {{end}}
76
-
59
+ {{ end }}
60
+ {{ end }}
77
61
{{ with .Title }}< span itemprop ="title "> {{ . }}</ span > {{ end }}
78
62
</ div >
79
63
{{ if .Params.toc }}
Original file line number Diff line number Diff line change 16
16
< div class ="highlightable ">
17
17
< ul class ="topics ">
18
18
{{ $page := . }}
19
-
20
- {{ if $page.Site.Params.createFromSiteMenusMain}}
21
- {{ range .Site.Menus.main }}
22
- < li class ="dd-item {{ if eq $page.RelPermalink .URL }}active{{ end }} {{if in $page.RelPermalink .URL }}parent{{ end }} " data-nav-id ="{{.URL}} ">
23
- < a href ="{{.URL}} ">
24
- < span > {{ .Pre }} {{ .Name }} {{ if $page.Site.Params.showVisitedLinks}} < i class ="fa fa-check read-icon "> {{ end }} </ i > </ span >
25
- </ a >
26
- {{ if .HasChildren }}
27
- < ul >
28
- {{ range $lvl2 := .Children}}
29
- < li class ="dd-item {{ if eq $page.RelPermalink $lvl2.URL }}active{{ end }} " data-nav-id ="{{$lvl2.URL}} ">
30
- < a href ="{{$lvl2.URL}} ">
31
- < span > {{ $lvl2.Pre }} {{ $lvl2.Name }} {{ if $page.Site.Params.showVisitedLinks}} < i class ="fa fa-check read-icon "> </ i > {{ end }} </ span >
32
- </ a >
33
-
34
- {{ if $lvl2.HasChildren }}
35
- <!-- if children has children 3rd level -->
36
- < ul >
37
- {{ range $lvl3 := $lvl2.Children}}
38
- < li class ="dd-item {{ if eq $page.RelPermalink $lvl3.URL }}active{{ end }} " data-nav-id ="{{$lvl3.URL}} ">
39
- < a href ="{{$lvl3.URL}} ">
40
- < span > {{ $lvl3.Pre }} {{ $lvl3.Name }} {{ if $page.Site.Params.showVisitedLinks}} < i class ="fa fa-check read-icon "> </ i > {{ end }} </ span >
41
- </ a >
42
- </ li >
43
- {{ end }}
44
- </ ul >
45
- {{ end }}
46
- </ li >
47
- {{ end }}
48
- </ ul >
49
- {{ end }}
50
- </ li >
51
- {{ end }}
52
- {{else}}
53
- <!-- Use default method, create menu from folder structure -->
54
-
55
19
{{ range $key , $value := .Site.Sections }}
56
20
{{ if ne $key "" }}
57
21
{{ $first := (index $value 0).Page }}
84
48
</ li >
85
49
{{ end }}
86
50
{{ end }}
87
-
88
- {{ end }}
89
-
90
-
91
-
92
51
</ ul >
93
52
< hr >
94
53
{{ if .Site.Params.showVisitedLinks}}
You can’t perform that action at this time.
0 commit comments