Hacker News new | ask | show | jobs
by watt3rpig 2443 days ago
Dumb question, but why do you need a static site generator vs just writing an html file?
4 comments

Say you write 10 blog articles. In HTML that's 10 files with some trivial cut & paste. In jekyll that's 10 markdown files and 1 HTML template. Equal time sink for both tasks.

Now you want to add Disqus comments to your blog. In HTML you edit 10 files. In jekyll that's probably 1 plugin. Same with adjusting theme, fonts, recent posts, generating RSS feed, recent Tweets, ads.

Basically, template compiling. Not having to copy/paste reusable parts around, which is error prone and time consuming. Depending on the tool there's other stuff, like generating sitemaps, optimizing images, CSS treeshaking and other optimizations, all the good stuff that would otherwise happen manually or not at all.
Ah thanks for the explanation.
Because HTML doesn't have a way to import another piece of HTML.
Every static site generator website has explanation for this.
I went to both Hugo and Jekyll sites. I did not see an explanation. Maybe I will try to build something and then I will understand.