Hacker News new | ask | show | jobs
by pknopf 2834 days ago
I tried using Gatsby for a project of mine. The moment I tried to do anything not supported OOTB, it seemed I was fighting the tooling (and webpack) at every corner. It was incredibly difficult just to get a simple tree navigation.

One thing I thankful for though is that it gave me a new-found love for the simple and non-flashy libs/tooling.

In the end, I wound up writing my own static site generator.

https://github.com/pauldotknopf/statik

You may say to yourself "So you just wrote your own Gatsby!?"

No, I didn't. I wrote a thin lib that you can register endpoints and extract them to disk. It does absolutely nothing else. The idea is that I will wrote my own markdown rendering, navigation, html/css, etc for each project. "But what about the time it takes to implement all the features you need!" The time it takes to implement these minor things take far less time in the long run, and I will never have to be in an endless fight with the tooling to get simple tree navigation. Every feature I implement is exactly what I need, no more, no less.

Sure, it isn't as cool as React, webpack, etc. But I'm a lot happier.

2 comments

Another great alternative is React Static. I moved to React Static after having the same issues with fighting with Gatsby plugins, the superfluous graphql environment for simple content handling, and finding that at the time Gatsby didn't scale well with larger websites.

https://github.com/nozzle/react-static

Did you evaluate Jekyll or Hugo for your use case?
I did. IMO, Hugo is the closest of any static gen to hitting the sweet spot of simplicity and feature set.

However, there were some features that I simply could not add to it. Features that if I didn't have the tooling bogging me down, I could implement in 10 minutes.

https://github.com/gohugoio/hugo/issues/3659

I can't fault Hugo for that GH issue though. The author's response is valid.

I know I sound grumpy. Hugo is great. It is a far better option than Gatsby. The features that it has are very simple and straightforward (no graph nodes/graphql/webpack-esque abstractions). I actually highly recommend Hugo.

edit: To add onto my original comment, I encourage people to read this blog post.

http://tonsky.me/blog/disenchantment/

I took the approach of bolting a second compiler on top of Hugo(a custom Python script) to get the extra things I wanted in Hugo.

It still took a while, but I did get to leverage the parts of Hugo that already work well.

I don't think there's much in the way of winning either way, since now I have a Build Process.

But it's your compiler, that does exactly what you want.

;)