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

Using getStaticProps #20

Closed
Rijast opened this issue Jun 21, 2021 · 2 comments
Closed

Using getStaticProps #20

Rijast opened this issue Jun 21, 2021 · 2 comments

Comments

@Rijast
Copy link

Rijast commented Jun 21, 2021

Is there a way to use getStaticProps with this? I want to generate my pages statically using an API but as far as I can tell this will only work with nextjs if the pages I am generating via slugs are within the /pages directory with the [] syntax. Do you know an easy way I could accomplish this keeping the same structure you have or how it might need to be modified?

Thanks lot!

@AlexcastroDev
Copy link

Is there a way to use getStaticProps with this? I want to generate my pages statically using an API but as far as I can tell this will only work with nextjs if the pages I am generating via slugs are within the /pages directory with the [] syntax. Do you know an easy way I could accomplish this keeping the same structure you have or how it might need to be modified?

Thanks lot!

I think getStaticProps works since it is not part of unsupported features: https://nextjs.org/docs/advanced-features/static-html-export#unsupported-features

But, idk how it works internally. Something broke ?

@mlynch
Copy link
Owner

mlynch commented Oct 2, 2022

getStaticProps should work just fine. You would create new pages in the root pages directory and then render that page tree from the top down. Right now there's a catch-all route that you would just remove or override for specific pages if you want to use getStaticProps

@mlynch mlynch closed this as completed Oct 2, 2022
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

3 participants