My blog posts are as following:
posts
/post-1
/en.mdx
/fr.mdx
I created a page for each in gatsby-node.js
file as following:
...
createPage({
path: `/${lang}/post/${node.frontmatter.slug}/`,
component: `${postTemplate}?__contentFilePath=${node.internal.contentFilePath}`,
context: {
id: node.id,
slug: node.frontmatter.slug,
lang: lang,
},
});
...
But if I go to url /fr/post/post-1
(or en), as gatsby-plugin-intl
creates /en/...
and /fr/...
, it redirects it to /en/en/post/post-1
or /fr/fr/post/post-1
.
Any solution?