From fcc48817f0edec90a37a6d7adca8e52f6ce6c91b Mon Sep 17 00:00:00 2001 From: sdiehl Date: Sat, 12 Mar 2022 10:21:57 +0000 Subject: [PATCH] Try to incoporate rewrites into router. --- site/next.config.mjs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/site/next.config.mjs b/site/next.config.mjs index 8073cd5..8f7f6fb 100644 --- a/site/next.config.mjs +++ b/site/next.config.mjs @@ -14,11 +14,27 @@ const withMDX = withMDXImp({ providerImportSource: "@mdx-js/react", }, }) -export default withMDX({ + + +const config = { // Append the default value with md extensions pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'], webpack: (config, { buildId, dev }) => { config.resolve.symlinks = false return config } -}) +} + +const rewrites = async () => { + return [ + { + source: '/concepts/:page(.md)', + destination: '/concepts/:page', + }, + ] +} + + +module.exports = { + withMDX(rewrites(config)) +}