mirror of
https://git.adityakumar.xyz/hugo-theme-introduction.git
synced 2024-11-09 23:09:47 +00:00
fixed "Back to Blog" and "Back to Projects"
This commit is contained in:
parent
87d371f468
commit
0dc9a5327a
1 changed files with 26 additions and 0 deletions
|
@ -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 }}
|
||||
|
|
Loading…
Reference in a new issue