mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2025-01-18 19:00:24 +00:00
Revert "Menu generation using Content file instead directories" (#10)
This commit is contained in:
parent
64012f31af
commit
00d849ce1f
2 changed files with 9 additions and 66 deletions
|
@ -48,20 +48,6 @@
|
|||
{{ if and (not .Params.chapter) (.Params.toc) }}
|
||||
<span id="toc-menu"><a href=""><i class="fa fa-list-alt"></i></a></span>
|
||||
{{ end }}
|
||||
{{ if $page.Site.Params.createFromSiteMenusMain}}
|
||||
{{ $type := .Params.menu.main.parent }}
|
||||
{{ $relLink := .RelPermalink }}
|
||||
{{ range $name , $value := .Site.Menus.main }}
|
||||
|
||||
{{ if eq $value.Identifier $type }}
|
||||
{{ if ne $relLink $value.URL }}
|
||||
<a href="{{ $value.URL }}" itemprop="url"><span itemprop="title"> <b>{{ $value.Name }}</b></span></a> <i class="fa fa-angle-right"></i>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{else}} <!-- use current method as default-->
|
||||
|
||||
{{ $type := .Type }}
|
||||
{{ $relLink := .RelPermalink }}
|
||||
{{ range $name , $value := .Site.Sections }}
|
||||
|
@ -72,8 +58,6 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{end}}
|
||||
|
||||
{{ with .Title }}<span itemprop="title"> {{ . }}</span>{{ end }}
|
||||
</div>
|
||||
{{ if .Params.toc }}
|
||||
|
|
|
@ -16,42 +16,6 @@
|
|||
<div class="highlightable">
|
||||
<ul class="topics">
|
||||
{{ $page := . }}
|
||||
|
||||
{{ if $page.Site.Params.createFromSiteMenusMain}}
|
||||
{{ range .Site.Menus.main }}
|
||||
<li class="dd-item {{ if eq $page.RelPermalink .URL }}active{{ end }} {{if in $page.RelPermalink .URL }}parent{{ end }}" data-nav-id="{{.URL}}">
|
||||
<a href="{{.URL}}">
|
||||
<span>{{ .Pre }} {{ .Name }} {{ if $page.Site.Params.showVisitedLinks}} <i class="fa fa-check read-icon"> {{ end }} </i> </span>
|
||||
</a>
|
||||
{{ if .HasChildren }}
|
||||
<ul>
|
||||
{{ range $lvl2 := .Children}}
|
||||
<li class="dd-item {{ if eq $page.RelPermalink $lvl2.URL }}active{{ end }}" data-nav-id="{{$lvl2.URL}}">
|
||||
<a href="{{$lvl2.URL}}">
|
||||
<span> {{ $lvl2.Pre }} {{ $lvl2.Name }} {{ if $page.Site.Params.showVisitedLinks}} <i class="fa fa-check read-icon"></i> {{ end }} </span>
|
||||
</a>
|
||||
|
||||
{{ if $lvl2.HasChildren }}
|
||||
<!-- if children has children 3rd level -->
|
||||
<ul>
|
||||
{{ range $lvl3 := $lvl2.Children}}
|
||||
<li class="dd-item {{ if eq $page.RelPermalink $lvl3.URL }}active{{ end }}" data-nav-id="{{$lvl3.URL}}">
|
||||
<a href="{{$lvl3.URL}}">
|
||||
<span>{{ $lvl3.Pre }} {{ $lvl3.Name }} {{ if $page.Site.Params.showVisitedLinks}} <i class="fa fa-check read-icon"></i> {{ end }} </span>
|
||||
</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
</li>
|
||||
{{ end }}
|
||||
{{else}}
|
||||
<!-- Use default method, create menu from folder structure -->
|
||||
|
||||
{{ range $key , $value := .Site.Sections }}
|
||||
{{ if ne $key "" }}
|
||||
{{ $first := (index $value 0).Page }}
|
||||
|
@ -84,11 +48,6 @@
|
|||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
<hr>
|
||||
{{ if .Site.Params.showVisitedLinks}}
|
||||
|
|
Loading…
Reference in a new issue