4 ms·
It seems like we've spent the past 25 years trying to solve the big headache this creates: you have 100 blog posts, which means 100 html files. Any structural c
by encomiast 2y ago
It seems like we've spent the past 25 years trying to solve the big headache this creates: you have 100 blog posts, which means 100 html files. Any structural change you need to make to the site involves touching all 100 files. CSS came along and helped separate the presentation from the information a bit, but it still sucked to maintain 100 html files on the server.
- xnorswap 2y agoIsn't this what Jekyll solves? Posts are all written as markdown, styling and layout are centralised with layout HTML pages and CSS. I believe indexes can be auto-updated via post metadata. And it's all static pages once generated, so there's no dynamic load on a database.
- mid-kid 2y agoI generally just have a makefile that for each page does `cat header.html page.html footer.html > out/page.html`. I realize this can be considered a "static site generator" but I think simple concatenation covers most of the painpoints of writing static sites manually, without introducing intermediate formats and complex processing. Another option is PHP, which was practically made for the purpose of generating HTML. You can run it on your pages to generate static versions, and just use "include" directives with that.
- thombles 2y agoYou're right but in my experience the annoyance factor jumps up as soon as you start wanting an RSS feed.
- skydhash 2y agoI wonder if you can have a snippet for that (can be a script that generate the code for one item) It’s not like such blog is updated thrice a day!
- glandium 2y agoOr "server side includes".
- jimmaswell 2y agoPHP is perfectly sufficient here. Add a static cache if the overhead gets too much.
- ryao 2y agoThere are static site generators. There are even plugins that turn Wordpress and Drupal into static site generators, such that you do not need to edit the files one at a time to make changes.
- imgabe 2y agoI sometimes go down this rabbit hole and wonder why people don't use server-side includes to just have Apache or nginx handle a common header / footer or whatnot. Seems like what they were made for. Are they slow or something?
- carlosjobim 2y agoThey're instant and they work great. PHP includes also.
- lelanthran 2y agoClient-side includes are easily done in a custom web component now. I use one. You can write a simple one in about 60 lines of JS. If all you need is include functionality, then that's the way to go for static file hosting.