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:
authorMax Bosche <max@enten.space>2019-04-18 10:10:42 +0300
committerMax Bosche <max@enten.space>2019-04-18 10:10:42 +0300
commit0dc9a5327a49a81532914ba385806b01e5c7f7da (patch)
tree2c6458cdd1aaa834924f00b56eef60c22f94dc16 /layouts
parent87d371f4687040452665bfe48a79687a0af80aa1 (diff)
fixed "Back to Blog" and "Back to Projects"
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 }}