(no title)
xfeeefeee | 6 months ago
Best of all, if you use simple unchanged files for other dynamic stuff like JSON etc, you can just generate those on build and serve those files in the host directly as the 'response' to a simple REST request, which is sometimes overlooked despite being the most fundamental form of a REST API.
I came across this after researching various options for a website that had, mostly for my own entertainment, restrictions on wanting to be mostly statically generated but customizable easily without learning a lot of new syntax / etc, something JSX-like with Markdown support etc, and MDX was an immediate find - and astro was the easiest SSG I found for it after trying with 11ty and several others. Actually felt like a delight playing with it.
jpjuni0r|6 months ago
Other web frameworks support this too, if you look for "static export" options. Next.js, for example, supports this via the getInitialProps function.
What I like especially about Astro, that you perform this data loading during build time from any component/file on your page. With Next.js, this is only possible via the top level Page component.
pjmlp|6 months ago
And if using app router model, that is part of React server components.
famahar|6 months ago
Built a few reusable templates and JSON for storing game data (maybe not ideal at scale, but seems to be working for now). JavaScript, CSS, and MDX. Hosted on Netlify which is an 'Official Deployment Partner'. It's light and simple. So far has been a joy to work with.