Browse Source

fix: handle link reformatting from home path (#1169)

NGPixel 5 years ago
parent
commit
8ba78dd771
1 changed files with 2 additions and 2 deletions
  1. 2 2
      server/modules/rendering/html-core/renderer.js

+ 2 - 2
server/modules/rendering/html-core/renderer.js

@@ -60,7 +60,7 @@ module.exports = {
           if (WIKI.config.lang.namespacing) {
           if (WIKI.config.lang.namespacing) {
             // -> Reformat paths
             // -> Reformat paths
             if (href.indexOf('/') !== 0) {
             if (href.indexOf('/') !== 0) {
-              href = `/${this.page.localeCode}/${this.page.path}/${href}`
+              href = (this.page.path === 'home') ? `/${this.page.localeCode}/${href}` : `/${this.page.localeCode}/${this.page.path}/${href}`
             } else if (href.charAt(3) !== '/') {
             } else if (href.charAt(3) !== '/') {
               href = `/${this.page.localeCode}${href}`
               href = `/${this.page.localeCode}${href}`
             }
             }
@@ -74,7 +74,7 @@ module.exports = {
           } else {
           } else {
             // -> Reformat paths
             // -> Reformat paths
             if (href.indexOf('/') !== 0) {
             if (href.indexOf('/') !== 0) {
-              href = `/${this.page.path}/${href}`
+              href = (this.page.path === 'home') ? `/${href}` : `/${this.page.path}/${href}`
             }
             }
 
 
             try {
             try {