move /slowniki subroutes to full routes

This commit is contained in:
Andrea Vos 2021-08-28 23:51:45 +02:00
parent 179827e1d0
commit 3a99dfff70
5 changed files with 19 additions and 18 deletions

View File

@ -161,10 +161,10 @@
extras.push(`/${this.config.nouns.route}/${subroute}`); extras.push(`/${this.config.nouns.route}/${subroute}`);
} }
if (this.config.inclusive.enabled) { 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) { if (this.config.terminology.enabled) {
extras.push(`/${this.config.nouns.route}/${this.config.terminology.route}`); extras.push(`/${this.config.terminology.route}`);
} }
links.push({ links.push({

View File

@ -1328,13 +1328,13 @@ census:
spis-2021: 'Raport ze Spisu 2021' spis-2021: 'Raport ze Spisu 2021'
redirects: redirects:
- { from: '^/neutratywy$', to: '/slowniki/neutratywy' } - { from: '^/slowniki/neutratywy$', to: '/neutratywy' }
- { from: '^/dukatywy$', to: '/slowniki/dukatywy' } - { from: '^/slowniki/dukatywy$', to: '/dukatywy' }
- { from: '^/osobatywy$', to: '/slowniki/osobatywy' } - { from: '^/slowniki/osobatywy$', to: '/osobatywy' }
- { from: '^/iksatywy$', to: '/slowniki/iksatywy' } - { from: '^/slowniki/iksatywy$', to: '/iksatywy' }
- { from: '^/inkluzywny', to: '/slowniki/inkluzywny' } - { from: '^/slowniki/inkluzywny', to: '/inkluzywny' }
- { from: '^/inkluzywnosc', to: '/slowniki/inkluzywny' } - { from: '^/slowniki/inkluzywnosc', to: '/inkluzywny' }
- { from: '^/terminologia', to: '/slowniki/terminologia' } - { from: '^/slowniki/terminologia', to: '/terminologia' }
- { from: '^/rzeczowniki$', to: '/slowniki' } - { from: '^/rzeczowniki$', to: '/slowniki' }
- { from: '^/slownik$', to: '/slowniki' } - { from: '^/slownik$', to: '/slowniki' }
- { from: '^/s%C5%82ownik$', to: '/slowniki' } - { from: '^/s%C5%82ownik$', to: '/slowniki' }

View File

@ -43,7 +43,7 @@
}, },
methods: { methods: {
buildRoute(route) { buildRoute(route) {
return `/${this.config.nouns.route}/${route}`; return `/${route}`;
}, },
isActiveRoute(route) { isActiveRoute(route) {
let current = decodeURIComponent(this.$route.fullPath).replace(/\/$/, ''); let current = decodeURIComponent(this.$route.fullPath).replace(/\/$/, '');

View File

@ -40,7 +40,7 @@
}, },
methods: { methods: {
buildRoute(route) { buildRoute(route) {
return `/${this.config.nouns.route}/${route}`; return `/${route}`;
}, },
isActiveRoute(route) { isActiveRoute(route) {
return decodeURIComponent(this.$route.fullPath).replace(/\/$/, '') === this.buildRoute(route).replace(/\/$/, ''); return decodeURIComponent(this.$route.fullPath).replace(/\/$/, '') === this.buildRoute(route).replace(/\/$/, '');

View File

@ -188,16 +188,17 @@ export default {
if (config.nouns.enabled) { if (config.nouns.enabled) {
routes.push({ path: '/' + config.nouns.route, component: resolve(__dirname, 'routes/nouns.vue') }); routes.push({ path: '/' + config.nouns.route, component: resolve(__dirname, 'routes/nouns.vue') });
for (let subroute of config.nouns.subroutes || []) { for (let subroute of config.nouns.subroutes || []) {
routes.push({ path: `/${config.nouns.route}/${subroute}`, component: resolve(__dirname, `data/nouns/${subroute}.vue`) }); routes.push({ path: `/${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')});
} }
} }
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) { if (config.names.enabled) {
routes.push({ path: '/' + config.names.route, component: resolve(__dirname, 'routes/names.vue') }); routes.push({ path: '/' + config.names.route, component: resolve(__dirname, 'routes/names.vue') });
} }