I'm working on a project for a "quotes" site that has a custom post type for quotes, and it currently houses over 6,500 posts, with more being added regularly. My aim is to extract only the quotes using either the REST API or GraphQL to display them in an app. I initially thought about using a static site generator, but given my hosting provider's limitations on the number of files and the frequent updates to the posts, that idea won't work.
I'm looking for a simple framework that can be easily integrated via a script tag—something that doesn't require building or using Node.js. I need this framework to support dynamic routing for generating post URLs on the fly, enable fetching and displaying posts using the JSON provided by my site, and allow for pagination. Any recommendations?
5 Answers
You might consider just using WordPress itself for this! It's pretty straightforward to set up templates in a child theme. Plus, WordPress already has pagination support built-in, so there's no need to create something from scratch. If you prefer a JavaScript approach, you can still do that, but only if you need extra interactivity on the page.
Next.js could work great for you! It's powerful and should meet all your requirements.
I'm not entirely sure about the stack you want to use, but if you're considering going headless, you might want to look into Payload or Strapi paired with a Next.js or Remix frontend. Statamic is another option if you prefer a PHP-based solution. Also, Getkirby is pretty user-friendly but might not handle big datasets as well.
Have you tried using Alpine.js with HTMX? It's lightweight and script-based, plus it supports dynamic routing, fetching JSON, and pagination without the hassle of builds or Node.js. It could be a great fit for what you're trying to achieve!
If you're leaning towards a headless approach, Next.js is a solid choice. It can give you a static site with incremental static regeneration, which can handle frequent updates well. Definitely worth checking out!
Thanks for the suggestion! HTMX seems really interesting. Can you explain what Alpine.js contributes to the setup? I saw that it doesn’t handle routing.