Hacker News new | ask | show | jobs
by superkuh 964 days ago
Maybe don't write a static site generator. Maybe just make a normal website made of individual HTML and other files that doesn't require any "generation" at all. Static site generators are supposed to be for getting away from complexity but most of the time they just shift the complexity away from being attackable.

There's no requirement for websites to be generated either statically or dynamically. The best websites are just files in folders.

1 comments

That's a great start, but the problem comes when you want to have a site menu and breadcrumbs and then you want to redesign it. No problem for 5 pages, but if you have even dozens you'll start wanting to do something more automated.
Use nginx (or whatever) and use server side includes for templating footers/menus/etc. It's extremely simple with the lowest possible attack surface for it's expressive power/utility. SSI should have never faded from the web dev toolkit; especially since it's actually still there in every popular webserver. Just,

    <p>whatever stuff here...lorem ispum, etc...</p>
    <!--# include file="/menu.html" -->
    <p>etc etc</p>
I use it extensively and it's great. You're still just working with .html files in folders.