diff options
-rw-r--r-- | layouts/partials/nav.html | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index 6cb0532..96c841f 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -55,10 +55,36 @@ {{ if ne .Name "contact.md" }} {{ if eq .File.Dir "projects/" }} <!-- Now for some cool projects --> + {{ if $isHome }} <a class="navbar-item" href="{{ printf "/#%s" ( .Title | urlize) | relLangURL }}">{{ .Title }}</a> + {{ else }} + {{ $pageIsInProjects := eq $.Page.Section "project"}} + {{ if not (and $pageIsInProjects (eq $.Page.Kind "section")) }} + <a class="navbar-item" href="{{ .Permalink }}"> + {{ if $pageIsInProjects }} + {{ i18n "nav_backToSection" . }} + {{ else }} + {{ .Title | singularize}} + {{ end }} + </a> + {{ end }} + {{ end }} {{ else if eq .File.Dir "blog/" }} <!-- Let`s show some blog posts --> + {{ if $isHome }} <a class="navbar-item" href="{{ printf "/#%s" ( .Title | urlize) | relLangURL }}">{{ .Title }}</a> + {{ else }} + {{ $pageIsInBlog := eq $.Page.Section "blog"}} + {{ if not (and $pageIsInBlog (eq $.Page.Kind "section")) }} + <a class="navbar-item" href="{{ .Permalink }}"> + {{ if $pageIsInBlog }} + {{ i18n "nav_backToSection" . }} + {{ else }} + {{ .Title | singularize}} + {{ end }} + </a> + {{ end }} + {{ end }} {{ else }} <a class="navbar-item" href="{{ if $isHome }}#{{ .File.TranslationBaseName }}{{ else }}{{ printf "/#%s" (.File.TranslationBaseName | urlize) | relLangURL }}{{ end }}">{{ .Title }}</a> {{ end }} |