A very basic Hugo theme, with bare-boned layouts and no CSS.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
771 B

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