Nice job! If only HTML had a serious templating system(no the template tag isn’t enough) that could be used without JavaScript, we won’t need any 3rd party system for assembling static sites. For example a mechanism for including partials with the tag and refer them inside a or directly into current html
Rewriting my website in plain HTML and CSS
21–30 of 218 posts
Re: Rewriting my website in plain HTML and CSS
#22Nice job! If only HTML had a serious templating system(no the template tag isn’t enough) that could be used without JavaScript, we won’t need any 3rd party system for assembling static sites. For example a mechanism for including partials with the tag and refer them inside a or directly into current html
In the 90s, we used Server Side Includes (SSI) for this. Probably still works.
https://caddyserver.com/docs/modules/http.handlers.templates
The "include" function should do the job:
{{include "path/to/file.html"}}
Re: Rewriting my website in plain HTML and CSS
#23Re: Rewriting my website in plain HTML and CSS
#24I've been maintaining my personal website as plain HTML for five years now. I must say, I quite like this method. There's no substitute for practice when it comes to maintaining your skills at editing HTML and CSS. Yes, you must copy and paste content and not having layout page is annoying at times. But the overhead of just doing it yourself is surprisingly small in terms of the time commitment. Typically, I'll draft…
Many people who maintain their own sites in vanilla web technologies tend to create reusable functions to handle this for them. It can generate headers and the like dynamically so you don't have to change it on every single page. Though that does kill the "no javascript required" aspect a lot of people like
Of course you could simply add a build step to your pure HTML site instead!
Re: Rewriting my website in plain HTML and CSS
#25Did he reinvent a static-site generator? Markdown, pandoc, makefile... Sounds like a job for hugo/eleventy/jekyll/whatever.
Looks around sheepishly
Re: Rewriting my website in plain HTML and CSS
#26Re: Rewriting my website in plain HTML and CSS
#27Earlier quoted context omitted.
In the 90s, we used Server Side Includes (SSI) for this. Probably still works.
One modern approach would be Caddy Server's templates, using Golang templating: https://caddyserver.com/docs/modules/http.handlers.templates The "include" function should do the job: {{include "path/to/file.html"}}
https://nginx.org/en/docs/http/ngx_http_ssi_module.html
Caddy chose not to, I guess?
https://caddy.community/t/caddy-update-on-ssi-server-side-in...
Re: Rewriting my website in plain HTML and CSS
#28The new paradigm of adding “use server”, “use cache”, and “use client” felt too magical by default.
Server actions are easy to forget adding validation and proper access control on. You need an external library to avoid the common pit falls.
I’ve been contemplating whether to move to something simple. The complexity creep is real.
Re: Rewriting my website in plain HTML and CSS
#29I still wanted the ability to have a common headers and footers and unique sections without repeating myself in every file. So I created a very small PHP application (just 5 files) and each page or blog post is a single PHP file in a directory. These PHP files have a small bit of metadata code at the top but are otherwise just plain HTML files. In each directory is layout file that wraps the content and these nest up the directory structure. So my site has a common header and footer and each section has their own subheader.
With the ability to publish by git push to the server, writing a blog post is as easy as creating a new file, git commit, and git push.
Re: Rewriting my website in plain HTML and CSS
#30I started a portfolio website with Netlify (iirc), then I moved to Vue + Gridsome (on GitHub pages), then Next.js with Tailwind CSS, and was about to move to Vite.js over winter break. That's 4 stacks over the course of 5-6 years. Not worth it. Decided to do the sensible thing and use GitHub's README functionality. I prefer this approach and wish more folks in the tech community adopted it: https://github.com/Subopti…
The UI is often tangential to the heavy lifting done by the back end. It often needs to be "just good enough".