diff --git a/src/.vuepress/theme/layouts/BlogPost.vue b/src/.vuepress/theme/layouts/BlogPost.vue index 9ff19698..15f5bce0 100644 --- a/src/.vuepress/theme/layouts/BlogPost.vue +++ b/src/.vuepress/theme/layouts/BlogPost.vue @@ -53,6 +53,8 @@ export default { }, }, mounted() { + // redirect routes that are not blog posts (/events, /videos, etc) + // to the homepage with the search parameter category if (!this.isVisible && this.$root.$page.frontmatter.type) { const type = this.$root.$page.frontmatter.type @@ -60,6 +62,8 @@ export default { return this.$router.replace({ path: `../?category=${type.slug}` }) } + // redirect any other blog post route that should not be visible + // to the 404 page (hidden or scheduled publish posts) if (!this.isVisible) { // path to 404 is relative to support ipfs sub path deployments return this.$router.replace({ path: '../404' })