Skip to content

Commit

Permalink
Add redirects for mobile feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
anli5005 committed Dec 8, 2023
1 parent 767d849 commit 82cc2fe
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ exports.createSchemaCustomization = ({ actions }) => {
}

exports.createPages = async ({ graphql, actions, reporter }) => {
const { createPage } = actions
const { createPage, createRedirect } = actions

/**
* Create pages for members
Expand Down Expand Up @@ -236,4 +236,20 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
}
},
})

// Create redirect for mobile feedback

// HACK: This is hardcoded for now, in the future we probably want a more
// scalable way to handle link shortening
const feedbackForms = [
{ slug: 'android', url: 'https://airtable.com/appFRa4NQvNMEbWsA/shrn4VbSQa8QDj8OG' },
{ slug: 'ios', url: 'https://airtable.com/appFRa4NQvNMEbWsA/shrVrNXT4PpI7nqvD' },
]

feedbackForms.forEach(({ slug, url }) => {
createRedirect({
fromPath: `/feedback/${slug}`,
toPath: url,
})
})
}

0 comments on commit 82cc2fe

Please sign in to comment.