Make links language-relative
This ensures that links work correctly in languages other than English. For example, clicking on the navbar "brand" link used to take you to the English home page even if you were browsing the site in another language. Now it takes you to the home page for that language.
This commit is contained in:
parent
655c2011fe
commit
c4cfe47e01
6 changed files with 12 additions and 12 deletions
|
|
@ -7,7 +7,7 @@
|
|||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
|
||||
<a class="navbar-brand" href="{{ "/" | absLangURL }}">{{ .Site.Title }}</a>
|
||||
</div>
|
||||
|
||||
<div class="collapse navbar-collapse" id="main-navbar">
|
||||
|
|
@ -18,13 +18,13 @@
|
|||
<a class="navlinks-parent" href="javascript:void(0)">{{ .Name }}</a>
|
||||
<div class="navlinks-children">
|
||||
{{ range .Children }}
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
<a href="{{ .URL | relLangURL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li>
|
||||
<a title="{{ .Name }}" href="{{ .URL }}">{{ .Name }}</a>
|
||||
<a title="{{ .Name }}" href="{{ .URL | relLangURL }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
@ -65,7 +65,7 @@
|
|||
<div class="avatar-container">
|
||||
<div class="avatar-img-border">
|
||||
{{ if isset .Site.Params "logo" }}
|
||||
<a title="{{ .Site.Title }}" href="{{ .Site.BaseURL }}">
|
||||
<a title="{{ .Site.Title }}" href="{{ "/" | absLangURL }}">
|
||||
<img class="avatar-img" src="{{ .Site.BaseURL }}/{{ .Site.Params.logo }}" alt="{{ .Site.Title }}" />
|
||||
</a>
|
||||
{{ end }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue