* Find first section for chevron navigation * Handle disabled section Co-authored-by: hossainemruz <emruz@appscode.com>
@@ -25,7 +25,10 @@
<li>{{ . }}</li>
{{ end }}
</ul>
- <!-- @todo this section should go to the first section, not necessarily about -->
- <a href="#about"><i class="arrow bounce fa fa-chevron-down"></i></a>
+ {{ if .Site.Data.sections }}
+ {{ range first 1 (where (sort .Site.Data.sections "section.weight") ".section.enable" true) }}
+ <a href="#{{ replace (lower .section.name) " " "-" }}"><i class="arrow bounce fa fa-chevron-down"></i></a>
+ {{ end }}
</div>
@@ -21,7 +21,7 @@
</li>
{{- if .Site.Data.sections }}
{{- range sort .Site.Data.sections "section.weight" }}
- {{ if .section.showOnNavbar }}
+ {{ if (and .section.enable .section.showOnNavbar) }}
<li class="nav-item">
<a class="nav-link smooth-scroll" href="#{{ replace (lower .section.name) " " "-" }}">{{ .section.name }}</a>