Live data from Hacker News

Why You Should Write Your Own Static Site Generator

arne.me

1–10 of 136 posts

Re: Why You Should Write Your Own Static Site Generator

#2
A fun experiment I’m sure but it’s not a very convincing argument for writing your own generator. In the same way the author claims frameworks will change, so will the tools that power their custom solution and using a framework will take a fraction of the time to get going.

Re: Why You Should Write Your Own Static Site Generator

#3
> [...] but most importantly you have to architect your website to match what the framework expects.

I guess that's what a framework is about. You get some abstractions that make your life easier and you pay by buying into the concepts.

> [...] some friends I've talked to where still on Next.js 12 and really felt the pressure to upgrade to not fall behind even more.

If the current version is doing its job, why update? It's a SSG not a browser that connects to the internet.

So I disagree. I'll not write my own and keep the existing one as long it's not too much hassle.

Re: Why You Should Write Your Own Static Site Generator

#5
post #4

I've never understood the point of these things. Just use a solid CMS and cache to s3 or Varnish. What's the big deal?

The deal is that a lot of static site generators are very complicated (perhaps needlessly so), despite the fact that static sites are technically very simple. Perhaps some people really leverage the power of Next.js, but when I tried it, I felt that it was super heavyweight when I just needed to template html files.

Of course, that doesn't mean I need to write my own. I just used a simpler SSG. In my case Jekyll.

Re: Why You Should Write Your Own Static Site Generator

#6
post #2

A fun experiment I’m sure but it’s not a very convincing argument for writing your own generator. In the same way the author claims frameworks will change, so will the tools that power their custom solution and using a framework will take a fraction of the time to get going.

This isn't really all that true and is highly dependent on the stack you want.

You can run Java from 1.1 on modern JREs. PHP from the early 2000s can still work. It all depends on what your stack looks like. If you're using the highly unstable "everything moves fast and constantly breaks" newer stuff, then sure. It's hard to see Python 3 breaking within the next 5-10 years, after how well the 2->3 changes were received.

I'd wager though even with newer languages, if you wrote something in Go, Rust, Kotlin, etc. today, it will still function in a decade.

Re: Why You Should Write Your Own Static Site Generator

#7
Did an SSG last month.

I had used pelican before; but I wanted to get a better handle on using Markdown and Jinja libraries "from the other side" as well. I would have needed to adapt my file structure or write some code to let pelican scan my idiosyncratic hierarchy to generate the posts.

Turns out Markdown is easier to use on your own scripts, than it is to tweak its configuration in pelican; and Jinja is quite simple too. Getting to use the "debug" feature to dump everything available to a template is nice.

I haven't bothered with RSS or sitemap yet, but i did do a nice calendar view render of my archive indexes; which i don't think could've been easily wedged into pelican's notion of how sites work. https://snafuhall.com/news.html

Re: Why You Should Write Your Own Static Site Generator

#8
post #4

I've never understood the point of these things. Just use a solid CMS and cache to s3 or Varnish. What's the big deal?

Being able to deploy a bunch of HTML files to static hosting services, no runtime like PHP etc. required.

If you use a CMS, it has to run somewhere. If you don’t want it on a server, you probably don’t have the same config on your dev machine. Most CMS require you to configure root domain paths etc. and they are different on your local machine. It’s all a lot more complicated than using an SSG to transpile a bunch of markdown files to HTML on a dev machine and upload them.

Post reply on HN