Live data from Hacker News

Why You Should Write Your Own Static Site Generator

arne.me

101–110 of 136 posts

Re: Why You Should Write Your Own Static Site Generator

#101

Earlier quoted context omitted.

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.

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.

> 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

Re: Why You Should Write Your Own Static Site Generator

#103
I would ALMOST agree.

Five years ago I dove into using an ultra-light-weight framework called MetalsmithJS. It's super minimal, but does what you need. I'd spent 10 years using the Drupal monolith, and did not regret the move. Yet it's open-source community dried up, but mostly because the framework does what it claims and then stopped expanding!

Here's a blog post... https://doublejosh.com/post/186193119278/metalsmithjs-is-sti...

Then two years ago I needed a more robust SSR system based on React, so I went with GatsbyJS. It's insanely mature and intuitive, but as we all know that community and business is now drying up too. But the framework is still great.

Now everyone sings the praises of NextJS, which can be used for SSR but is intended for applications and active server endpoints. But more complexity doesn't mean better.

I'm keen to try other simple frameworks when the result is a static site. I may give https://www.11ty.dev a shot.

Re: Why You Should Write Your Own Static Site Generator

#104
post #20

I'm not sure I'd advocate for writing a static site generator, although I'm certainly guilty of writing a few myself. Instead I always encourage people who are trying to start blogging to do the writing first. Figure out a workflow that works for you - what time of day you prefer writing, what editor, do diagrams naturally come up in your thought stream, etc. It's way easier to get this workflow dialed in when you're…

> I'm certainly guilty of writing a few myself. So am I. My first one was written in C in 1995, and the resultant site run under NCSA Httpd. DIY-ing becomes tedious after several cycles, though. On the other hand, my experience with generally available SSGs has been miserable. They keep breaking my site after a few upgrades. At this point, I am very close to just spinning up wordpress for a new site.

Well, that gives you more opportunities to have to update plug-ins and dodge vulnerabilities. Maybe a ton of people are a good fit for core WP these days, but I can't imagine the overhead of knowing what to update beyond the auto-updating core if there are a bunch of extensions.

I admin a local org's WP site, because someone has to, and thoroughly appreciate the SSG that I use personally.

Re: Why You Should Write Your Own Static Site Generator

#105

Earlier quoted context omitted.

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.

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.

> 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.

Re: Why You Should Write Your Own Static Site Generator

#106
I see a lot of people building their own static site generators. There's probably a lot of common elements to the process, right? We should abstract those commonalities into a static site generator generator, so that everyone who needs to write a static site generator doesn't need to reinvent the wheel.

Re: Why You Should Write Your Own Static Site Generator

#107

I see a lot of people building their own static site generators. There's probably a lot of common elements to the process, right? We should abstract those commonalities into a static site generator generator, so that everyone who needs to write a static site generator doesn't need to reinvent the wheel.

There are a few that take that approach, but people usually want one in their preferred programming language/runtime. Examples:

Metalsmith (Node/JS): https://metalsmith.io/

Haunt (Guile Scheme): https://dthompson.us/projects/haunt.html

I’m sure there are many more.

Re: Why You Should Write Your Own Static Site Generator

#108

I would ALMOST agree. Five years ago I dove into using an ultra-light-weight framework called MetalsmithJS. It's super minimal, but does what you need. I'd spent 10 years using the Drupal monolith, and did not regret the move. Yet it's open-source community dried up, but mostly because the framework does what it claims and then stopped expanding! Here's a blog post... https://doublejosh.com/post/186193119278/metalsmi…

I built my own static site generator with Drupal 8 for a project. It was a good experience and made my company a lot of money.

We went with Gatsby for our overhaul and honestly, not looking back unless forced to. I realize it doesn't scale all that well but we're at ~10,000 pages and our build time is about 8 minutes without a lot of optimization. Given our refresh interval is 15 minutes, nothing to worry about from my perspective.

People keep chattering that NextJS might suit our needs better but GatsbyJS sure ain't broke.

Re: Why You Should Write Your Own Static Site Generator

#109
post #20

I'm not sure I'd advocate for writing a static site generator, although I'm certainly guilty of writing a few myself. Instead I always encourage people who are trying to start blogging to do the writing first. Figure out a workflow that works for you - what time of day you prefer writing, what editor, do diagrams naturally come up in your thought stream, etc. It's way easier to get this workflow dialed in when you're…

I created md2blog[1] specifically for this reason: it prevents you from making design decisions, so you’re forced to focus on writing posts instead.

I’m well aware of the irony of building yet another SSG to help people avoid doing the same. But I’m addicted to building SSGs—this one was my fifth, and I’m considering making another one (insert facepalm here).

[1] https://jaredkrinke.github.io/md2blog/

Post reply on HN