chore: add comments to explain redirects

This commit is contained in:
Ze Bateira
2021-04-21 16:06:05 +01:00
parent 52af0cfdf1
commit a6de0bd24f
+4
View File
@@ -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' })