fixed "Back to Blog" and "Back to Projects"

This commit is contained in:
Max Bosche 2019-04-18 09:10:42 +02:00
parent 87d371f468
commit 0dc9a5327a

View file

@ -55,11 +55,37 @@
{{ if ne .Name "contact.md" }} {{ if ne .Name "contact.md" }}
{{ if eq .File.Dir "projects/" }} {{ if eq .File.Dir "projects/" }}
<!-- Now for some cool projects --> <!-- Now for some cool projects -->
{{ if $isHome }}
<a class="navbar-item" href="{{ printf "/#%s" ( .Title | urlize) | relLangURL }}">{{ .Title }}</a> <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/" }} {{ else if eq .File.Dir "blog/" }}
<!-- Let`s show some blog posts --> <!-- Let`s show some blog posts -->
{{ if $isHome }}
<a class="navbar-item" href="{{ printf "/#%s" ( .Title | urlize) | relLangURL }}">{{ .Title }}</a> <a class="navbar-item" href="{{ printf "/#%s" ( .Title | urlize) | relLangURL }}">{{ .Title }}</a>
{{ else }} {{ 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> <a class="navbar-item" href="{{ if $isHome }}#{{ .File.TranslationBaseName }}{{ else }}{{ printf "/#%s" (.File.TranslationBaseName | urlize) | relLangURL }}{{ end }}">{{ .Title }}</a>
{{ end }} {{ end }}
{{ end }} {{ end }}