fixed navbar dropdown function

This commit is contained in:
HenzelMoras 2021-03-26 22:10:05 +05:30
parent a35e3b792d
commit 8363889012

View file

@ -75,8 +75,17 @@
</a> </a>
{{ end }} {{ end }}
<div class="dropdown-menu" aria-labelledby="navbarDropdown"> <div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#achievements">Achievements</a> {{ range sort $sections "section.weight" }}
<a class="dropdown-item" href="#recent-posts">Recent Posts</a> {{ if and (.section.enable) (.section.showOnNavbar) }}
{{ $sectionID := replace (lower .section.name) " " "-" }}
{{ if .section.id }}
{{ $sectionID = .section.id }}
{{ end }}
{{ if gt .section.weight 6 }}
<a class="dropdown-item" href="#{{ $sectionID }}">{{ .section.name }}</a>
{{ end }}
{{ end }}
{{- end }}
</div> </div>
</li> </li>