Hacker News new | ask | show | jobs
by miroljub 964 days ago
But if you write a static site generator, you can blog about it. And that can be the first and the last post of your blog.

If you don't write one, the chance is good, your blog would stay empty.

4 comments

Why are you personally attacking me like this?

In all seriousness does everyone and their mom write a static site generator? I did because its fun and easy. Off the shelf ones can be cumbersome and not work quite how I want them to.

I made one for a single page that I wanted to template nicely without introducing dynamic pages (wasteful since it's always the same file anyway) or JavaScript (wasteful since the layout is always the same anyway)

I'll probably do another one again soon, just so I don't have to rewrite my HTML / RSS by hand to publish another post.

Lua is a nice data language, so I just put the data and the code and the HTML fragments into one Lua file, no more than 200 lines. No worries about injection since it's all my data with no backend code at runtime.

I've thought about it only because I hate having to figure out someone's frameworks and way of doing things.

I'm not a professional programmer and it feels like most of these are for people who already work with various frameworks professionally and know their way around these things. I am too old to spend time trying to figure out all the frameworks so I'd rather just whip up something with my half-assed skills and DIY.

> Off the shelf ones can be cumbersome and not work quite how I want them to.

This is why I wrote mine! You just put all your markdown in one folder, run it, then collect your HTML in another folder.

https://github.com/donuts-are-good/bearclaw

> Off the shelf ones can be cumbersome and not work quite how I want them to.

Yeah, that's exactly why I reinvent wheels!

I ended up forking an existing templating language and customizing it into a static site generator. I'm not sure what's more difficult: changing other people's code or doing it from scratch.

You forgot 3rd option maybe hardest - just using other people code and understanding it instead of misusing it, calling it crap and going to write ones own broken thing. ;)
I don't think I ever called anyone else's work "crap" though. The software I forked is the pug templating language. It's unmaintained, looks like the author has moved on. Most of my work involved deleting the features I didn't need so that it would be easier to understand and work with. It had a Javascript parser inside it.

But yeah, I get what you mean. It's definitely the hardest thing to do.

I guess he wrote „you“ in a generic sense.
Also, every 2 years post "I've neglected my blog for a long time, but that's about to change now!" ... and then another 2 year silence.
Guilty as charged, many times over. Sometimes, to the point where I could not even recall the old workflow post login.
This is the perfect summary all the setups people have, with lots of "wow, I feel personally attacked" included: https://rakhim.org/honestly-undefined/19/
Nice. Your comics are rather amusing.
Sounds like you are the visitor my blog had?