You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not an issue but a question. It's the first time I am using Gatsby and this plugin gatsby-plugin-intl. My site consists of only static pages and I am using the config to support two locales en and ja.
My requirement is to generate separate builds and host them on separate domains. For example ja.example.com should serve the Japanese site and en.example.com should serve the English site. Is it possible to tweak the build process of Gatsby to generate independent builds for both?
Like instead of public directory, I want to generate two separate directories, public-en and public-ja and then use those builds for my deployment.
The text was updated successfully, but these errors were encountered:
After tweaking with the config a bit, here is what I came up with. I am using the environment variable LANG in gatsby-config.js to set the default language and a onPostBuild function in gatsby-node.js to rename the public directory to public-${process.env.LANG} and removing the subdirectories en and ja from the generated build.
This works fine as per my requirements. I would still be interested in knowing if there is any downside to this approach or is there any better (recommended) way to accomplish what I am doing.
I think this would actually perhaps be the preferred approach at scale. You could easily have all this automated and have CI build and deploy individual builds where the env variable is set to language for that build.
This is not an issue but a question. It's the first time I am using Gatsby and this plugin
gatsby-plugin-intl
. My site consists of only static pages and I am using the config to support two localesen
andja
.My requirement is to generate separate builds and host them on separate domains. For example
ja.example.com
should serve the Japanese site anden.example.com
should serve the English site. Is it possible to tweak the build process of Gatsby to generate independent builds for both?Like instead of
public
directory, I want to generate two separate directories,public-en
andpublic-ja
and then use those builds for my deployment.The text was updated successfully, but these errors were encountered: