|
|
|
|
|
by MatthewPhillips
3887 days ago
|
|
The downside to static site generators is that you are constantly recreating the entire site, even for pages that won't change (which is most of them, most of the time) every time you run it. It's a function of: template(data) -> html
I'm a fan of the inverse of this. The template and the output (html) are the same thing; I don't separate them. Instead I just update the html when something changes. The function is: update(html, data)
Where update is a function you write that modifies the html in place.The upside to this is that generating new content is cheap, you only ever update the things that need updating. The downside is that your html output and updating function are tightly coupled; you can't change the structure of your html without also changing your update function. I think that's ok though. Changing templates are infrequent enough to warrant the increased cost of fixing everything when you do change them. |
|