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

github.com/vickylaixy/hugo-theme-introduction.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/nav.html26
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 }}