From a6de0bd24f5d71a9b4209191b655b9db8631846c Mon Sep 17 00:00:00 2001 From: Ze Bateira Date: Wed, 21 Apr 2021 16:06:05 +0100 Subject: [PATCH] chore: add comments to explain redirects --- src/.vuepress/theme/layouts/BlogPost.vue | 4 ++++ 1 file changed, 4 insertions(+) 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' })