Most of the static site generators don’t seem to generate “sites”. They instead generate “blogs”, with the concept of posts and pages very deep-rooted in the implementation.
I mention because I recently came across statik which is a static site generator written in Python which really lets you generate sites. You get to define the “models” which you’d like your site to have (if you define Post and Page models, you have something like pelican). Imagine Django, but compile-time (for the lack of a better analogy).
I might write a blog (heh) post on this later, but I would definitely suggest checking it out if you’re interested in static sites.
I maintain 3 websites, two with Jekyll (https://monix.io and https://typelevel.org/cats-effect/) and one with Middleman (https://alexn.org).
Both Jekyll and Middleman are perfectly capable for static websites. The blogging part is just a nice built-in feature.
I’ve been using Nikola (edit: for my landing page), because at the time it was the only one that had incremental builds. You have to follow their guide to reconfigure it for a non-blog setup: https://getnikola.com/creating-a-site-not-a-blog-with-nikola.html
VuePress has my interest now, especially once Netlify support is implemented.
Edit: I also have Sphinx instances: one as a public wiki and the other as a private notes repo.
The handful or so that I have worked with all support defining models, Sculpin and Tapestry (i’m the author) call them content types, Jigsaw calls them collections. All three can be used to generate a static site, but for convenience (and likely because the usual users are minimalist bloggers) they come “blog aware” which simply means they have a blog collection configured out of the box.
I have used all three and a few others such as metalsmith (which also supports collections via plugin) for the purpose of generating small static sites with a handful of pages for clients as well as reasonable sized multi author blogs.
TL;DR, yes some SSGs come shipped with blog content types (models) pre-configured but that doesn’t make them only good for generating blogs.
This is interesting. I wish it didn’t use YAML though.
For the website, I ended up making a custom generator, and focus on blogs in most generators was one of the biggest reasons, even though not the only one.
Most of the static site generators don’t seem to generate “sites”. They instead generate “blogs”, with the concept of > posts and pages very deep-rooted in the implementation.
Bravo for saying this. I’ve faced the same problem, with static generators forcing me to give an author / date setting for each page. This might make sense for blogs, but doesn’t for the simple site I want to build.
And most of them force you to do things a certain way; it is so painful, which is no wonder people just go back to Wordpress.
Amy Hoy wrote a great article on this : https://stackingthebricks.com/how-blogs-broke-the-web/
Note that the “idempotence” definition that people use to describe side effectful actions is not the mathematical definition.
In math a function is idempotent if:
f(f(x)) = f(x)
This becomes very relevant in functional programming, as in FP the definition of idempotence is the math definition. Mentioning this in order to avoid confusion.
As always developers are overloading math terms in a way as to confuse everyone :-)
I don’t find the resemblance very intuitive. I was familiar with the meaning in TFA and got very confused when acquainted with the math definition.
Also in FP and in computer science in general the more correct term for executing effectful actions only once and then caching the result for subsequent calls is “memoization”.
correct term for executing effectful actions only once and then caching the result for subsequent calls is “memoization”
Memoizing actions which have observable side effects seems more like the sort of situation where you shouldn’t be using memoization. As I understand it the term usually implies an optimization that doesn’t change a program’s semantics, and that’s only the case when the function being memoized is referentially transparent.
Publishers know what they are doing. Nobody cares about people wanting to block Javascript.
You can disable Javascript of course and at this point the web is still usable without it. However publishers will increasingly turn to protections against JS blockers, you can thank the increasing aggressiveness and popularity of ad blocking extensions for that.
You can disable JavaScript but not with a usable UI, so practically most people cannot.
Also, JavaScript should be disabled by default, enabled on a per site basis and marked as “Not Secure” anyway.
Browsers should make SRI mandatory for JavaScript and they should take special attention to suspect HTTP headers used with scripts.
Interestingly sites like ebay and amazon do work fine without javascript. Not quite as comfortable but no quirks there either. Ebay has gotten worse over the years I admit….
Their is a fairly good compromise. I use uMatrix which blocks 3rd party scripts by default and gives you a ui to enable them as needed. Quite often it doesn’t break anything and when it does it’s usually super easy to work out that a script from a cdn is important but a script from twitter or google analytics is not.
If you’re looking for an excuse to learn Haskell, there’s also Hakyll, a static website generator built with Haskell and it’s pretty nice: https://jaspervdj.be/hakyll/
Hakyll sure does seem to be the go-to static site generator for Haskellers or people interested in Haskell, but I’ve found it to be somewhat complex, at times needlessly so.
I’d recommend checking out Slick (successor to SitePipe), built on top of the Shake build system. There’s also yst but I haven’t had a close look at it yet.