3 ms·
Personally I don't find static site generators worth the effort to learn or keep up-to-date as versions inevitably come. I end up just writing my own for each s
by eatonphil 5y ago
Personally I don't find static site generators worth the effort to learn or keep up-to-date as versions inevitably come. I end up just writing my own for each site in 1-200 lines of Python. It's normally just a markdown library and a template engine wrapped with a file system walker.
Here's an example: https://github.com/eatonphil/notes.eatonphil.com/blob/master/scripts/build.py https://github.com/eatonphil/notes.eatonphil.com/blob/master.... It's longer than usual since it embeds parts of the home page html inside it.
These scripts last for years and only change slightly over time. Very low maintenance.
- abricot 5y agoYou don't find them worth the effort, but you wrote your own?
- eatonphil 5y agoUpdated to clarify that it is the time it takes to learn and the upkeep over time that I find not worthwhile.
- brandonmenc 5y agoThe popular static site generators all accommodate very large sites. Which is great, but it can them very time consuming to learn if all you want to do is throw up some blog posts. Writing a small static site generator for a personal site can be done in an afternoon, and it's fun.
- petepete 5y agoNanoc fills this niche quite well. It's more of a SSG toolkit than an SSG. You build a Rules file with steps for each of your file types and it loops through and builds your site. It comes with Markdown out of the box but you can make it do just about anything. https://nanoc.app/ https://nanoc.app/
- drran 5y agoPandoc + Makefile is enough. https://github.com/ivanstojic/pandoc-ssg/blob/master/Makefile https://github.com/ivanstojic/pandoc-ssg/blob/master/Makefil...
- tekkk 5y agoAt that point why wouldnt you just write HTML? That would last basically forever and it's I think less hassle than hacking together a blog renderer.
- tonyedgecombe 5y agoI'm not the GP but if HTML supported client side includes then that would be enough for most of my sites.
- eatonphil 5y agoHow often has markdown changed over the years? The markdown library I use has not changed its API in over 3 years at least. The only reason this script is more than two lines of markdown-related code is because I wanted to store headers for other things. This script is the most complex of my SSGs because I write on this blog the most. But even then it's only 200 LoC which is still (to me) surprisingly small. Other of my SSGs are even simpler and have no markdown renderer: just jinja and file walking code. So I'm not really sure which part of <200 LoC and no upstream changes you consider a hassle.