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

This commit is contained in:
NGPixel 2019-11-01 23:59:22 -04:00
parent 400c0d3998
commit 8ba78dd771

View File

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