Commit 8ba78dd7 authored by NGPixel's avatar NGPixel

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

parent 400c0d39
...@@ -60,7 +60,7 @@ module.exports = { ...@@ -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 = { ...@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment