Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config option to force using getStaticProps #17

Open
rscotten opened this issue Mar 31, 2023 · 1 comment
Open

Config option to force using getStaticProps #17

rscotten opened this issue Mar 31, 2023 · 1 comment

Comments

@rscotten
Copy link

rscotten commented Mar 31, 2023

What version of this package are you using?

2.02

What problem do you want to solve?

We work on a website template for clients in North America and Brazil. Their websites (which are built off of this template) are in their native language (English and Portuguese respectively).

We know the locale/language of each website at build time; our clients don't want or need a language switcher.

SEO and fast page loads is a primary concern. Therefore, we want to build and ship the website with only one language as a static website using next export.

We don't want the plugin to decide for us. We accept the risk of HOC collisions, dynamic paths, etc. and will deal with that on our own.

What do you think is the correct solution to this problem?

We want a simple config option in i18n.js to force the loader to use getStaticProps for loading the language files so that we can export a static website. Something like:

module.exports = {
  ...,
  forceStatic: true
}

Otherwise, we have to add getStaticProps to EVERY page of our template and all client pages which is ugly and costly.

Are you willing to submit a pull request to implement this change?

Yes, if @aralroca approves.

PR at #18

@rscotten rscotten changed the title Option to force using getStaticProps Config option to force using getStaticProps Mar 31, 2023
@aralroca
Copy link
Owner

aralroca commented Apr 1, 2023

Ok, make sense in order to avoid the behavior with HOC. Feel free to PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants