From dea81ca4343531e3a38fcaf9a605df1cacd096aa Mon Sep 17 00:00:00 2001
From: a1x42 <github@rohde76.de>
Date: Mon, 05 Aug 2019 12:33:43 +0000
Subject: [PATCH] main link does not switch back to default language if in another language (#202)

---
 exampleSite/config.toml      |   16 ++++++++--------
 layouts/partials/header.html |    4 ++--
 CONTRIBUTORS.md              |    1 +
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index bae54bc..9647c04 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -41,3 +41,4 @@
 - [Jia "Jay" Tan](https://github.com/j7an)
 - [Ryan](https://github.com/alrayyes)
 - [Naim A.](https://github.com/naim94a)
+- [Alexander Rohde](https://github.com/a1x42)
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index d4e086b..ffdd198 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -84,22 +84,22 @@
         [[languages.en.menu.main]]
         name = "About"
         weight = 1
-        url = "/about/"
+        url = "about/"
 
         [[languages.en.menu.main]]
         name = "Blog"
         weight = 2
-        url = "/posts/"
+        url = "posts/"
 
         [[languages.en.menu.main]]
         name = "Projects"
         weight = 3
-        url = "/projects/"
+        url = "projects/"
 
         [[languages.en.menu.main]]
         name = "Contact me"
         weight = 5
-        url = "/contact/"
+        url = "contact/"
 
 
     [languages.pt-br]
@@ -118,19 +118,19 @@
             [[languages.pt-br.menu.main]]
             name = "Sobre"
             weight = 1
-            url = "/pt-br/about/"
+            url = "about/"
 
             [[languages.pt-br.menu.main]]
             name = "Blog"
             weight = 2
-            url = "/pt-br/posts/"
+            url = "posts/"
 
             [[languages.pt-br.menu.main]]
             name = "Projetos"
             weight = 3
-            url = "/pt-br/projects/"
+            url = "projects/"
 
             [[languages.pt-br.menu.main]]
             name = "Contato"
             weight = 5
-            url = "/pt-br/contact/"
+            url = "contact/"
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 2c3de47..0f9197b 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,6 +1,6 @@
 <nav class="navigation">
   <section class="container">
-    <a class="navigation-title" href="{{ .Site.BaseURL | absLangURL }}">
+    <a class="navigation-title" href="{{ .Site.BaseURL | relLangURL }}">
       {{ .Site.Title }}
     </a>
     <input type="checkbox" id="menu-toggle" />
@@ -9,7 +9,7 @@
       {{ with .Site.Menus.main}}
         {{ range sort . }}
           <li class="navigation-item">
-            <a class="navigation-link" href="{{ .URL | safeURL }}">{{ .Name }}</a>
+            <a class="navigation-link" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
           </li>
         {{ end }}
       {{ end }}

--
Gitblit v1.10.0