| 1 | <ul> |
| 2 | {{ $currentPage := . }} |
| 3 | {{ range .Site.Menus.main }} |
| 4 | {{ if .HasChildren }} |
| 5 | <li class="{{ if $currentPage.HasMenuCurrent "main" . }}active{{ end }}"> |
| 6 | <a href="#">{{ .Pre }} <span>{{ .Name }}</span></a> |
| 7 | </li> |
| 8 | <ul class="sub-menu"> |
| 9 | {{ range .Children }} |
| 10 | <li class="{{ if $currentPage.IsMenuCurrent "main" . }}active{{ end }}"> |
| 11 | <a href="{{ .URL }}">{{ .Name }}</a> |
| 12 | </li> |
| 13 | {{ end }} |
| 14 | </ul> |
| 15 | {{ else }} |
| 16 | <li> |
| 17 | <a href="{{ .URL }}">{{ .Pre }} <span>{{ .Name }}</span></a> |
| 18 | </li> |
| 19 | {{ end }} |
| 20 | {{ end }} |
| 21 | </ul> |