diff --git a/components/PixLink.vue b/components/PixLink.vue index 9c47fe49e..f31748421 100644 --- a/components/PixLink.vue +++ b/components/PixLink.vue @@ -69,18 +69,15 @@ function getRelativeLinkPrefix(url) { if (!url) { return '' } - let defaultPrefixes - if (process.env.isPixPro) { - defaultPrefixes = 'https://pro.pix.fr/' - } else { - defaultPrefixes = 'https://pix.org/,https://pix.fr/' - } + const defaultPrefixes = process.env.isPixPro + ? 'https://pro.pix.fr' + : 'https://pix.org,https://pix.fr' const relativeLinkPrefixes = ( process.env.RELATIVE_LINK_PREFIXES || defaultPrefixes ).split(',') return relativeLinkPrefixes .map((relativeLinkPrefix) => - url.startsWith(relativeLinkPrefix) ? relativeLinkPrefix : '' + url.startsWith(relativeLinkPrefix) ? `${relativeLinkPrefix}/` : '' ) .filter((relativeLinkPrefix) => relativeLinkPrefix !== '')[0] } diff --git a/components/slices/NavigationZone.vue b/components/slices/NavigationZone.vue index de4e1fe31..7eed9ef7f 100644 --- a/components/slices/NavigationZone.vue +++ b/components/slices/NavigationZone.vue @@ -17,6 +17,9 @@