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}`);
}
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({

View File

@ -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' }

View File

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

View File

@ -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(/\/$/, '');

View File

@ -188,14 +188,15 @@ 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`) });
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')});
routes.push({path: `/${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: `/${config.terminology.route}`, component: resolve(__dirname, 'routes/terminology.vue')});
}
if (config.names.enabled) {