Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/hossainemruz/toha.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Tipton <jason@blueyetisoftware.com>2020-07-02 18:21:09 +0300
committerGitHub <noreply@github.com>2020-07-02 18:21:09 +0300
commit865877321268e0a2484a87b75bcb2507a3932278 (patch)
treea57c207eaffc5156556e4904302e9b63a698a4b2 /layouts
parent436746b1701f5983c17f8c90ff2b4445c176678c (diff)
Find first section for chevron navigation (#26)
* Find first section for chevron navigation * Handle disabled section Co-authored-by: hossainemruz <emruz@appscode.com>
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/home.html7
-rw-r--r--layouts/partials/navbar.html2
2 files changed, 6 insertions, 3 deletions
diff --git a/layouts/partials/home.html b/layouts/partials/home.html
index 90e3dd7..2f825a7 100644
--- a/layouts/partials/home.html
+++ b/layouts/partials/home.html
@@ -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 }}
+ {{ end }}
</div>
</div>
diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html
index 253c54d..00570c7 100644
--- a/layouts/partials/navbar.html
+++ b/layouts/partials/navbar.html
@@ -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>
</li>