Static site generators to watch in 2021
netlify.com
netlify.com
I am but a humble designer, who only knows enough to write some simple prototypes, and wants some organizational helps. Partials. Concatenating stylesheets. Little things that I used to use CodeKit for.
And I like Hugo because of that “it’s just a binary” bit. There’s no dependency hell. No leaning tower of JS or Ruby. You install it, it sits there, nothing can really break. That’s what I want.
Is that a niche criteria? Obviously. But I do appreciate it. (And if someone has a better suggestion for a very simple static site generator, bring it on.)
So you kind of have to decide, are just static templates and static assets all you need? Stick with Hugo and enjoy the speed, simplicity, etc. There are some even simpler alternatives you might enjoy too, like mdbook or mkdocs. Both are more oriented towards technical docs but are similar to hugo at their core--send in some markdown (in the case of these tools you don't even need frontmatter or other schema) and get out some HTML.
If you're building something fancier or using more complex frontend setups then... there's no perfect answer right now. It's all about balancing complexity of the build system with what it gives you in the output. IMHO webpack and gnarly dependencies can be tamed pretty well with a simple docker container. Spend some time getting your perfect workflow setup, chuck it in a container that a CI system can run all day, every day without fail, and you'll be pretty well setup.
src/entrypoints/donate.js defined a custom element, which was included on layouts/donate-page/single.html and layouts/partials/get-src.html conditionally included the Vue component either with Parcel's dev server in testing or precompiled files in production.
It's not very different from what you'd do in any not-JS web framework.
In my particular instance: yup. I’m at the “loop through an array of things in a folder” level, not “deploy at scale” level.
I had that issue with Jekyll, I just couldn't get the set up to work on my system (to be fair, I gave up easily instead of asking for help).
When I came across Zola (https://github.com/getzola/zola), I was immediately drawn by the single binary aspect.
I love Gridsome, and it had tons of potential, but it's effectively a dead project. The maintainers haven't cut a new release since November 2020.[0] There's barely been any feature work since 2019.[1] Their Github repos have tons of PRs that have not been reviewed. There are serious site-killing bugs that have not been fixed for over a year.[2]
I really wanted this project to succeed. I asked to sponsor the project and volunteered working on their documentation for a few months, but it didn't seem to yield any new dev work.
The maintainers are extremely talented, and this is not a knock against them, but I just caution anyone against marrying themselves to a framework that's unlikely to have any ongoing maintenance.
[0] https://github.com/gridsome/gridsome/releases
[1] https://github.com/gridsome/gridsome/graphs/code-frequency
- https://github.com/netlify/netlify-cms
- https://github.com/strapi/strapi
- https://github.com/directus/directus
- https://github.com/tinacms/tinacms
- https://github.com/sanity-io/sanity
- https://github.com/wintercms/winter
- https://github.com/Camberi/firecms (tied to firestore)
As recompense, some lesser known options for the frontend part of the JAMstack that weren't mentioned in the original post:
NotePad++
sublimeText
PineGrow - https://pinegrow.com
CoffeeCup (site designer, html editor, form makers) -https://www.coffeecup.com/
BlueGriffon is a static site maker even has wysiwyg - https://en.wikipedia.org/wiki/BlueGriffon / http://www.bluegriffon.org/
I loved making pages and sites with NetObjects fusion the most - it seems that PineGrow is the closest thing to that but modern.
There are also a couple of 'Wordpress goes Static' plugins ( https://wordpress.org/plugins/simply-static/ is one of them ) that can pipe out static html pages from a WP install - and they are handy for positives of having a static site - with the bonus of all the WP themes - of course doing that destroys the dynamic things you may want - site search, contact forms, comments - but handy for the right use case.
In a pinch it is sometimes faster to pop open notepad and paste in an html5 boilerplate add some text and save it - done.
It's quite trivial to pull in bootstrap, bulma or similar with an include line or two and start making a page / generating a static site.
I ended up using Pandoc and a Makefile. It works really well.
Javascript can still be statically loaded in this situation and could be used to provide UI elements (such as collapsible sections) or even an interactive local search.
Edit: Just to be clear, I'm not saying web pages should be mostly statically generated html with a bit of JS. The point is that someone developing a web app shouldn't normally be concerned about whether or not it's static.
Sometimes the reason is the dev workflow rather than the output.
It's been around for a long time. Has lots of plugins. Easy to extend. Fairly active development.
A while ago I was picking a new SSG and I would have preferred something written in Python so I can hack on it more easily. I ended up moving on because of the license.
I am now very happily using Hugo.
Not sure I see it as a problem, though. I'm producing static files, and uploading them to a web server. At no point is a user communicating with the program - which I think is the key clause that triggers the AGPL. The whole discussion about templates being treated as code is enlightening - but again: No user is communicating with the templates either.
Furthermore, even if I'm wrong on this, I don't see the leap that the content of the blog has to be AGPL. At worst, I'd merely have to release my templates and any other modifications I've made to the code (custom plugins, etc).
The practical problem is that some organizations simply discourage or don't allow the use of GPLv3 or AGPL software. I don't want to learn one tool for personal projects and another for potential work projects, in case the opportunity comes up.
The easiest way to deal with that is to just switch to a tool that has a license that is more widely accepted.
No - it suggests that I'm not a lawyer. I would use those phrases for any license.
Let me put it concretely. Had I read the AGPL, I would have concluded that there is no problem in this use case - just as I would with the GPL or any permissive license. It's only because others disagree, for reasons that seem faulty to me, that I hesitate. Frankly, for me, this is a good example of (unintentional) FUD.
> The practical problem is that some organizations simply discourage or don't allow the use of GPLv3 or AGPL software.
I thought the issue was GPL vs AGPL. If you're avoiding GPL, then it makes it more understandable. In any case, I use it for personal reasons. Were I considering it for our work, we would consult with our lawyers (have done so in the past) - regardless of the license. My work does not involve the web, so I don't have the concern of having to learn two different tools.
In the years since, I write code to get my desired output via Pelican probably once every few years, but it's totally been worth it to have that option. I really got sick of "Let's search to see if someone's written a plugin that does exactly what I need." And then to have the plugin broken with an upgrade.
One aspect of static site development nobody seems to want to do is to keep themes up to date.
30 seconds after posting the comment, I found this:
https://aur.archlinux.org/packages/pandoc-bin/
I don't know why I never tried to look for it. But I can attest to that fact pandoc + miniserve is a very interesting static site stack for those who want ultra simple.
I built this because it was extremely difficult to embed Middleman or Jekyll into a Rails site. While I was building it, I discovered that Rails actually has a LOT of stuff in it already that make it work well for a static site compiler.
I run it in a few places, with the largest deployment at https://www.polleverywhere.com. At Poll Everywhere it's happily been serving up content pages for a few years. I've switched all of my personal static websites over to it as well.
Here's what's kind of crazy about Sitepress: you can use it to compile static websites -- OR -- you can embed it in rails and do things dynamically like display a "Login" vs "Logout" button state. The choice of "static" vs "dynamic" just isn't a big deal with Sitepress, you can have it both ways.
Last thing: I'm currently working on making Sitepress serve up Notion and Webflow content. This can be really helpful for teams that need to deal with multiple CMS formats from large teams.
Check out Bridgetown, "a Webpack-aware, Ruby-powered static site generator for the modern Jamstack era". It's come a long way since it forked from Jekyll a year ago [1].
I will say there is currently a lot of momentum behind other projects when it comes to the "out of box" themes that are available. I'd like to see more community maintained themes.
I made my templates and CSS (SASS) from scratch. I would have released them if they weren't so bespoke. I'd like to see some that make use of well-known CSS frameworks (eg. Bulma or Tailwind).
What always drives me away from SSGs or what I don't understand: to create new content, you need to have your development environment.
What I would like to have would be Grav [1], but based on Python. With Grav you can log in, create or adjust your Markdown-files and you instantly have your new or changed content, from every browser in the world. You can also easily create your own backend/frontend forms within the application. I know that this is basically a CMS and not a SSG, but it allows me to adjust the content of a basically static site.
I also know that there is also Python-based Lektor [2], however I found Nikola more intriguing than this one.
And this smaller one: https://github.com/collections/static-site-generators
I wish we had a common specification around static-site generators though, something akin to CommonMark - so it was easier to switch between generators without having to spend time porting things around. The Jekyll directory structure for eg, is mostly respected various implementations - but it isn't a accepted everywhere for eg.
Haven't used it myself yet, just heard about it in John's Static Site Generation Corner on the Stacktrace podcast.
To your original point, if you want something really simple this might work (haven't tried it, just found it on Google): https://github.com/gomarkdown/mdtohtml
And then for CSS, you could drop in something like this: https://github.com/andybrewer/mvp
Thanks, that’s what I meant, just didn’t think I needed to spell it out for this crowd :)
I'm cheering for it and I don't want to come off as discouraging for a product that I didn't pay for, but it has a long way to go. A lot of my work with it (but not all) was pre-1.0 though, so maybe it's improved.
export const MyComponent = ({ first, last }) =>
<h1>Hello, {first} {last}!</h1>
you'd just do this: export const myFragment = ({ first, last }) =>
`<h1>Hello, ${first} ${last}!</h1>`
No dependencies (or build steps!) requiredThe user entered <script> you should save that verbatim, but there are many output formats, HTML, SQL, PS (Post Script), XLS etc etc where you need to escape user provided values
I'm not sure quite what you think static site generators do if you're comparing them to a CDN, but they take a set of scripts, markup, images, and whatever else you care to mix in, and then emit a static site - just a bunch of HTML/CSS/JS/etc. You can host it on anything that supports serving static files - Google Cloud Storage works (especially when fronted by Cloudflare, data bandwidth between those two companies is cheaper), a random old server, etc.
You typically render it locally, then simply upload the changes to whatever you're using to host.
Not all websites (and not even all websites dealing with somewhat dynamic content such as blogs) need a full server stack, and the security of the server is far better if it's just serving files.
I transitioned my blog from Blogger (when they updated it last summer and absolutely ruined the core functionality of their editor, which is editing text) to a Jekyll-rendered site. It works out well, and I simply integrate a Discourse instance I run for a variety of things into the templates to have a functional comment section for posts.
Many sites don't need to be dynamically generated - they just need to provide some text and pics or whatever.
Some bonuses with non-dynamic - no worries if a php update fails - no worries if some other server side thing is broken - just serve files - no thinking.
Less worries about cpu overload - like having a dozen wordpres sites on a box - you can run into problems if one of those sites is getting hammered by login requests or similar - even if you 100% prevent them from logging in - you are still eating up php and what not which may affect your other dynamically generated sites on the server more than some static files that need to be pushed.
Of course you are right in that modern CDNs and cacheing make much of what used to be bigger problems more trivial in general..
A single site on a VPS less likely to be of concern compared to shared hosting or a dedicated box with several sites - in my experience - situations vary.