Replies: 1 comment
-
I found a solution to my problem. Adding Here's some more information. I did a build with Honestly, it's hard for me to understand how I've realized my problem has more to do with NextJS than it does with Keystatic. I apologize for the noise. Thanks again for making such great software! |
Beta Was this translation helpful? Give feedback.
-
I'm building my first NextJS site. I chose Keystatic because it had good documentation and looked easy to use. I'm loving it! Also, kudos to simonswiss for making such concise and useful video guides about it. They've been very helpful in my learning process.
In my site, if I use the github reader to fetch content, all the pages that call it become dynamic pages. I'm importing the GitHub reader from a file that exports it as
reader = createGitHubReader(...)
. I also tried using React Cache asexport const reader = cache(() => createGitHubReader(...))
, which I saw used in the Keystatic docs repo, but with the same results.The exception is that dynamic routes with
generateStaticParams
get generated as static pages, as they should. To isolate the effect of the reader on whether pages become dynamic or not, I've commented out all of the components for each page, so that they are empty except for the calls to the Keystatic reader.What adjustments should I make to my code so that all pages are statically generated when using the GitHub reader? Is it possible? All the needed information is available at build time. Or maybe I've overlooked something else that is causing the pages to be dynamic. Any pointers or suggestions would be greatly appreciated! Like I said, this is my first NextJS project, and I'm still learning how things work.
Beta Was this translation helpful? Give feedback.
All reactions