mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-12-22 22:52:54 +00:00
Fix nav
This commit is contained in:
parent
ebd3b152f4
commit
26d6a45c1c
2 changed files with 9 additions and 3 deletions
|
@ -40,7 +40,6 @@
|
|||
{{ with .Site.GetPage "page" "home" }}
|
||||
{{ $home := . }}
|
||||
{{ range sort (.Resources.ByType "page") "Params.weight" }}
|
||||
|
||||
{{ if ne .Name "contact.md" }}
|
||||
<!-- Range through all sections in /home execept contact.md -->
|
||||
<div class="section" id="{{ .File.TranslationBaseName }}">
|
||||
|
|
|
@ -39,9 +39,14 @@
|
|||
{{ if not $isHome }}
|
||||
<a class="navbar-item" href="{{ "/" | relLangURL }}">{{ i18n "nav_main" . }}</a>
|
||||
{{ end }}
|
||||
{{ with .Site.GetPage "page" "about" }}
|
||||
|
||||
{{ with .Site.GetPage "page" "home" }}
|
||||
{{ range sort (.Resources.ByType "page") "Params.weight" }}
|
||||
{{ if ne .Name "contact.md" }}
|
||||
<a class="navbar-item" href="{{ if $isHome }}#{{ .File.TranslationBaseName }}{{ else }}{{ printf "/#%s" .File.TranslationBaseName | relLangURL }}{{ end }}">{{ .Title }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $pageIsInProjects := eq .Page.Section "projects"}}
|
||||
{{ if not (and $pageIsInProjects (eq .Page.Kind "section")) }}
|
||||
|
@ -77,9 +82,11 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ with .Site.GetPage "page" "contact" }}
|
||||
{{ with .Site.GetPage "page" "home" }}
|
||||
{{ with .Resources.GetMatch "contact.md" }}
|
||||
<a class="navbar-item" href="{{ if $isHome }}#{{ .File.TranslationBaseName }}{{ else }}{{ printf "/#%s" .File.TranslationBaseName | relLangURL }}{{ end }}">{{ .Title }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if gt (len $.Site.Home.AllTranslations.ByWeight) 1 }}
|
||||
{{ range $.Site.Home.AllTranslations.ByWeight }}
|
||||
|
|
Loading…
Reference in a new issue