Tina, Astro and the mystery of disappearing posts


Slowly moving forward with the migration to Astro. I recently moved all the posts from Hugo and with that I changed the default folder location to be higher in the directory tree to tidy everything up.

With Hugo I was using page bundles, but decided to move away from that in favor of simpler organization. I was also organizing my posts by year (each year has a different folder) and this I wanted to keep.

At first sight everything looked fine, but after I deployed the site, I noticed that the newest posts are gone. In fact, a whole year or two was missing.

I searched to see if I messed up something during tidying up, or turned on some filtering, but couldn't find the issue. I was thinking maybe there were too much folders with years. What was strange, I noticed, that when I renamed folder /2026 to /!2026, the newest posts were visible again. But then the other ones that would be at the end of the list would be gone.

I was stumped. Maybe it's some kind of a cache? Maybe I need to refresh TinaCMS config again, or make it from scratch?

I found the right track only after I counted how many posts were generated when I built a site. It was precisely 50.

It turns out, querying posts through GraphQL in TinaCMS is limit to 50 by default and I was oblivious to that limit.

Unfortunately, the default theme does not support pagination, so it tried to load all the posts for listing and hit this limit.

With the help of AI I was able to fix that by creating a function that queries multiple times to get all posts. Probably there's already some ready made library for that, but for now I will leave it like that and will work on adding pagination to the theme.