I've looked at a number of "static site generators", but it seems all of them are oriented towards producing a blog site. I mean, they usually talk about "posts" (and also have "pages"), they automatically create index pages, ordering the "posts", and provide a number of other features (RSS, etc.).<p>Does anyone know of a "general" static site generator, where there are no such preconceived notions?<p>I only want to generate a number of HTML pages, based on an arbitrary number of templates.
Why does it matter if they're called posts, pages, or bananas?<p>Static site generators take input, run it through templates, and produce html output. This seems to be, literally, what you want to do. Maybe try and implement what you want and you'll see they can do it.<p>I use Hugo to generate some static pages that sit inside a dynamic website. It's just Go templating, which is not too hard to learn. You can create individual pages that pull in multiple templates if you want. You can switch off RSS, change naming from posts to bananas, etc. Very few preconceived regulations.<p>Most of the static generators are used for blogs, that's probably why most examples they give are around blog posts. It doesn't mean the name 'post' actually means anything special.
My favorite static site generator is Org mode[1] for Emacs. Org files are written using a feature-rich lightweight markup language[2] that is much more powerful than Markdown (e.g., plain text spreadsheets). Org files can be exported to HTML[3].<p>The reason I prefer Org for static site generation is not because I already use Emacs. I actually started using Emacs about 20 years ago specifically to use Org mode.<p>[1] <a href="https://orgmode.org/" rel="nofollow">https://orgmode.org/</a><p>[2] <a href="https://orgmode.org/features.html" rel="nofollow">https://orgmode.org/features.html</a><p>[3] <a href="https://orgmode.org/manual/HTML-Export.html" rel="nofollow">https://orgmode.org/manual/HTML-Export.html</a>
I think this is more a question of how you want to create and store your content and templates, like whether they exist as a bunch of Markdown files, database entries, a third-party API, etc. They're typically made to work in some sort of toolchain or ecosystem.<p>For example, if you're working in the React world, Next.js can actually output static HTML pages that work fine without JS... just use the pages router and a static export (<a href="https://nextjs.org/docs/pages/guides/static-exports" rel="nofollow">https://nextjs.org/docs/pages/guides/static-exports</a>). That still lets you use all the power of JS and expressiveness of React components, minus the interactivity, of course (if you don't want JS). But you could still pass in components and such. It's a bit like writing serverside includes in the PHP or Perl days. The benefit of using Next is its incredible popularity; probably whatever question you have, someone else has already asked and ten people have answered it. The downsides are its complexity and its frequent changes; answers from just a year or two ago are probably irrelevant to the current version, and there is a steep learning curve at first. But in SSG mode with the pages router, it's pretty straightforward, and the filesystem-based routing makes it very clear what the final directory structure would be.<p>For Markdown there's <a href="https://docusaurus.io/" rel="nofollow">https://docusaurus.io/</a>
and <a href="https://github.com/rust-lang/mdBook">https://github.com/rust-lang/mdBook</a><p>Eleventy is another option for various templating languages: <a href="https://www.11ty.dev/" rel="nofollow">https://www.11ty.dev/</a><p>See also these lists:<p><a href="https://jamstack.org/generators/" rel="nofollow">https://jamstack.org/generators/</a><p><a href="https://github.com/myles/awesome-static-generators">https://github.com/myles/awesome-static-generators</a>
Try Hugo[1]. In depends on a template[2] you choose whether Hugo will generate a landing page, a website, a blog, etc.<p>[1] <a href="https://gohugo.io" rel="nofollow">https://gohugo.io</a><p>[2] <a href="https://themes.gohugo.io" rel="nofollow">https://themes.gohugo.io</a>
I recently used Astro [0] to make TrumpOrderTracker.com [1] and it was a great experience. It can definitely handle much more than just blogs.<p>[0] <a href="https://astro.build/" rel="nofollow">https://astro.build/</a><p>[1] <a href="https://trumpordertracker.com/" rel="nofollow">https://trumpordertracker.com/</a>