Live data from Hacker News

Rewriting my website in plain HTML and CSS

vijayp.dev

21–30 of 218 posts

Re: Rewriting my website in plain HTML and CSS

#21

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

You could use HTMX.org ;)

Re: Rewriting my website in plain HTML and CSS

#22

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

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"}}

Re: Rewriting my website in plain HTML and CSS

#24

I'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…

> Yes, you must copy and paste content

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

#27

Earlier 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"}}

httpd, nginx, a number of other servers support SSI

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

#28
Recently redesigned my site [1] and used nextjs app router (moved from page router).

The 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.

1] https://saksham.work

Re: Rewriting my website in plain HTML and CSS

#29
I also decided to develop my personal website in plain HTML. I looked into a bunch of static site generators and found that direction to be too complicated and slow for me.

I 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

#30

I 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…

I hate the UI layer, for this reason. Nothing is ever stable. I'm looking for "Boring" and "Googleable in the age of AI slop". The other alternative are frameworks small enough to easily comprehend.

The UI is often tangential to the heavy lifting done by the back end. It often needs to be "just good enough".

Post reply on HN