-
-
Save rayriffy/f9548acc2c57421833f0b21a1c5c6af8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Generate page from dynamic URLs that match RegExp | |
*/ | |
exports.onCreatePage = async ({page, actions}) => { | |
const {createPage} = actions | |
if (page.path.match(/^\/g/)) { | |
page.matchPath = '/g/*' | |
createPage(page) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment