My static site is build by a generator. A generator that literally runs after each save and it takes milliseconds to compile my site. I also have autorefresh plugin for development, so as soon as I save a file whatever page I had open in my browser "instantly" gets refreshed.
Many static site generators are so fast that you could use, say, the unix `watch` command to rebuild your website every two seconds while running an `http-server` locally to preview the results. And then just rsync the artifacts when ready to deploy.
I was talking about execution, not coding. Dynamically creating a page that's mostly static content doesn't really benefit from instant updates.
Consider that recently static site generators have been enjoying quite a popularity, as they enable you to have a very simple server-side system (static web server only, or something like Amazon's S3) and work well under load (being "slashdotted/reddited/HN'd"), without extensive caching.
It may require regenerating all pages, but depending on the generator that may not be particularly expensive - they may cache partial assets, so you replace part of the build asset and then the build is basically a bunch of cat-like calls, which tend to be extremely cheap.
The largest static site I've managed was only a couple thousand pages (2138 pages from the last build log), but the build time was around 8 seconds (8.1 from the last build log) with cached build assets.
I'd be happy using a static generator for most sites.
That sounds completely counter-intuitive to me. A static site generator is run once you add something to your site, i.e. not that often. So a slight hit in startup speed isn't really a factor, whereas runtime efficiency is (dependencies are hard, so most SSG's out there recreate the whole site for each new post/page).
Some static generators like eleventy and Gatsby offer partial builds, only building the new posts etc. which should be considerably faster. Another thing would be to run an empty version of your site with only the text you're working on and when it's done, moving it to the proper site and building it then
Many static site generators, including Hugo and Jekyll, have file watching support and even automatic page reloads, so their workflow is barely different from editing raw html. You have to jump through some more hoops for raw html, but I expect you save time overall.
My experience is just limited hobby stuff, but it sounds very similar to the other static site generators out there I've used that do auto-reload on changes.
Looks like it's all mainly to do with the static site generation though. You can certainly still dump some handmade html into a gh-pages branch and have a (non-generated) static site in less than ten minutes.
That’s worth mentioning, but I was looking to run the static site generator locally because the workflow of committing to Git, waiting for a build, etc. is too slow for iterating (and also difficult to debug when stuff inevitably doesn’t work as expected).
I also rewrote my blog's static site generator to a bespoke one (in Dart in my case), largely for performance reasons. Prior, I was using Jekyll and Pygments. Jekyll and Pygments are really slow. My new site generator is literally 100x faster, and I did, like, zero real optimization work. In fact, it can rebuild my entire blog and every post from scratch faster than Jekyll's watch mode (with caching set up properly) could rebuild a single page.
Businesses, even very capable with web dev, update their websites very rarely. Businesses want to update the content, which is different. Static site generators are built exactly for that.
Have you checked out Hugo? It's builds are pretty fast, and it has a watch function for rapid dev work.
Not sure how you'd get away from a build on updates though, it is called a static site __generator_. If you want to skip the build entirely, just write .html files and call it a day.
The issue is with transferring older material to the site. Lot more than an afternoon, there..
I agree, though. Static site generators are nice. I will probably look at doing one, sooner or later.
My issue is that I like to have a fairly "branded" experience, so I want to control all kinds of stuff. I'm not usually one to leave "standard" templates in place, without peeing on them.
I recently started blogging again, and I chose to go with a static site generator. It's fast, really fast. Loading a whole page with each click is so much faster than visiting most of the sites I visit each day.
I'll never get why we collectively decided that it's reasonable to grant every random website in the world execute permissions on our machines.
reply