Re:Ask HN: Are there any downsides to building a blog using ...
by perilunar on Tuesday September 22, 2020 @10:45AM
(#24554999)
There are various ways to do client-side includes, but they mostly rely on JS to load and insert the HTML fragments.
Simple enough if you just want to include a few common elements and don't want a build step. Not so good if you want actual templating.
Re:Ask HN: Are there any downsides to building a blog using ...
by dylz on Tuesday September 22, 2020 @05:08AM
(#24552434)
Some people will tell you about frames and framesets
Re:Ask HN: Are there any downsides to building a blog using ...
by seanwilson on Tuesday September 22, 2020 @05:38AM
(#24552604)
They're really impractical for this use though as they don't act the same way as HTML being inlined into your page e.g. the elements inside the iframe won't influence the size of the iframe making responsive layout a pain, CSS on the parent page won't act on the HTML inside the iframe, sharing state via JavaScript is more complex. Pages that have e.g. contact forms that are really iframes tend to stand out a mile for example.
I can recommend Hugo if all you need is the above (and more). It's a single binary to install/run, runs super fast and you only need to learn a couple of template tags for the above.
I'm not keen on Gatsby or Jekyll because they're an order of magnitude slower as far as I know and require you to have a pile of Node and Ruby (respectively) dependencies set up which is an extra headache and stuff that can break.
Every now and then my site that uses Jekyll will break when I push to Netlify because something changed somewhere and it's a massive drag (I know proper containerisation would solve this but this is extra work and expertise required). Hugo is really simple in contrast because you don't have any dependencies to isolate or require a complex build script.