From 3a99dfff7027395f64ef11024f20f4c949614651 Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Sat, 28 Aug 2021 23:51:45 +0200 Subject: [PATCH] move /slowniki subroutes to full routes --- components/Header.vue | 4 ++-- locale/pl/config.suml | 14 +++++++------- locale/pl/nouns/NounsNav.vue | 2 +- locale/yi/nouns/NounsNav.vue | 2 +- nuxt.config.js | 15 ++++++++------- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/components/Header.vue b/components/Header.vue index e61e99253..c5969980c 100644 --- a/components/Header.vue +++ b/components/Header.vue @@ -161,10 +161,10 @@ extras.push(`/${this.config.nouns.route}/${subroute}`); } if (this.config.inclusive.enabled) { - extras.push(`/${this.config.nouns.route}/${this.config.inclusive.route}`); + extras.push(`/${this.config.inclusive.route}`); } if (this.config.terminology.enabled) { - extras.push(`/${this.config.nouns.route}/${this.config.terminology.route}`); + extras.push(`/${this.config.terminology.route}`); } links.push({ diff --git a/locale/pl/config.suml b/locale/pl/config.suml index ec58da543..0eda13a4c 100644 --- a/locale/pl/config.suml +++ b/locale/pl/config.suml @@ -1328,13 +1328,13 @@ census: spis-2021: 'Raport ze Spisu 2021' redirects: - - { from: '^/neutratywy$', to: '/slowniki/neutratywy' } - - { from: '^/dukatywy$', to: '/slowniki/dukatywy' } - - { from: '^/osobatywy$', to: '/slowniki/osobatywy' } - - { from: '^/iksatywy$', to: '/slowniki/iksatywy' } - - { from: '^/inkluzywny', to: '/slowniki/inkluzywny' } - - { from: '^/inkluzywnosc', to: '/slowniki/inkluzywny' } - - { from: '^/terminologia', to: '/slowniki/terminologia' } + - { from: '^/slowniki/neutratywy$', to: '/neutratywy' } + - { from: '^/slowniki/dukatywy$', to: '/dukatywy' } + - { from: '^/slowniki/osobatywy$', to: '/osobatywy' } + - { from: '^/slowniki/iksatywy$', to: '/iksatywy' } + - { from: '^/slowniki/inkluzywny', to: '/inkluzywny' } + - { from: '^/slowniki/inkluzywnosc', to: '/inkluzywny' } + - { from: '^/slowniki/terminologia', to: '/terminologia' } - { from: '^/rzeczowniki$', to: '/slowniki' } - { from: '^/slownik$', to: '/slowniki' } - { from: '^/s%C5%82ownik$', to: '/slowniki' } diff --git a/locale/pl/nouns/NounsNav.vue b/locale/pl/nouns/NounsNav.vue index 802a3bf46..8d26f7279 100644 --- a/locale/pl/nouns/NounsNav.vue +++ b/locale/pl/nouns/NounsNav.vue @@ -43,7 +43,7 @@ }, methods: { buildRoute(route) { - return `/${this.config.nouns.route}/${route}`; + return `/${route}`; }, isActiveRoute(route) { let current = decodeURIComponent(this.$route.fullPath).replace(/\/$/, ''); diff --git a/locale/yi/nouns/NounsNav.vue b/locale/yi/nouns/NounsNav.vue index a7ffd0925..9df8f9cdb 100644 --- a/locale/yi/nouns/NounsNav.vue +++ b/locale/yi/nouns/NounsNav.vue @@ -40,7 +40,7 @@ }, methods: { buildRoute(route) { - return `/${this.config.nouns.route}/${route}`; + return `/${route}`; }, isActiveRoute(route) { return decodeURIComponent(this.$route.fullPath).replace(/\/$/, '') === this.buildRoute(route).replace(/\/$/, ''); diff --git a/nuxt.config.js b/nuxt.config.js index e327e2463..18e4231b0 100644 --- a/nuxt.config.js +++ b/nuxt.config.js @@ -188,16 +188,17 @@ export default { if (config.nouns.enabled) { routes.push({ path: '/' + config.nouns.route, component: resolve(__dirname, 'routes/nouns.vue') }); for (let subroute of config.nouns.subroutes || []) { - routes.push({ path: `/${config.nouns.route}/${subroute}`, component: resolve(__dirname, `data/nouns/${subroute}.vue`) }); - } - if (config.inclusive.enabled) { - routes.push({path: `/${config.nouns.route}/${config.inclusive.route}`, component: resolve(__dirname, 'routes/inclusive.vue')}); - } - if (config.terminology.enabled) { - routes.push({path: `/${config.nouns.route}/${config.terminology.route}`, component: resolve(__dirname, 'routes/terminology.vue')}); + routes.push({ path: `/${subroute}`, component: resolve(__dirname, `data/nouns/${subroute}.vue`) }); } } + if (config.inclusive.enabled) { + routes.push({path: `/${config.inclusive.route}`, component: resolve(__dirname, 'routes/inclusive.vue')}); + } + if (config.terminology.enabled) { + routes.push({path: `/${config.terminology.route}`, component: resolve(__dirname, 'routes/terminology.vue')}); + } + if (config.names.enabled) { routes.push({ path: '/' + config.names.route, component: resolve(__dirname, 'routes/names.vue') }); }