From 52af0cfdf17a47bdcf9cc5567ed36664b6d07a9c Mon Sep 17 00:00:00 2001 From: Ze Bateira Date: Wed, 21 Apr 2021 15:57:48 +0100 Subject: [PATCH] fix: redirect category routes to search route --- src/.vuepress/theme/layouts/BlogPost.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/.vuepress/theme/layouts/BlogPost.vue b/src/.vuepress/theme/layouts/BlogPost.vue index 50d4d681..9ff19698 100644 --- a/src/.vuepress/theme/layouts/BlogPost.vue +++ b/src/.vuepress/theme/layouts/BlogPost.vue @@ -53,6 +53,13 @@ export default { }, }, mounted() { + if (!this.isVisible && this.$root.$page.frontmatter.type) { + const type = this.$root.$page.frontmatter.type + + // path is relative to support ipfs sub path deployments + return this.$router.replace({ path: `../?category=${type.slug}` }) + } + if (!this.isVisible) { // path to 404 is relative to support ipfs sub path deployments return this.$router.replace({ path: '../404' })