Replies: 1 comment
-
I have exactly the same usecase, except that I get the data from an headless CMS. Every examples I saw fetched all the posts in getStaticProps in one query then do the pagination + load more on the client, but this is not scalable for hundreds of posts. In the next js docs, it is mentionned that during getStaticProps a json is also generated but I have no idea how to leverage it. Did you find a solution in the meantime? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Is it possible in some way to make Next generate static JSON files, such as it does pages?
My use case: I have a blog with traditional pagination. All pages are built with SSG (
blog/pages/1
,blog/pages/2
, etc.). But I need to also add an infinite scrolling feature. Therefore my frontend code will need to request data of the articles in the next page to add them to the current list, when the user is scrolling to the bottom.All my articles are MDX inside the codebase (no CMS). At first, I built an API endpoint but I was hit with #24700. Moreover, this is something that could very much be pre-generated:
blog/pages/1.json
,blog/pages/2.json
, and so on.What is the best way I could achieve this with next?
Beta Was this translation helpful? Give feedback.
All reactions