Live data from Hacker News

Rewriting my website in plain HTML and CSS

vijayp.dev

81–90 of 218 posts

Re: Rewriting my website in plain HTML and CSS

#81

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 Manual work is almost never a good solution. Try this: for PAGE in *.page do cat header.html "$PAGE" footer.html > “$PAGE.html” done

A slightly simpler version of same is:

  for PAGE in *.page
  do
    cat header.html "$PAGE" footer.html > "$PAGE.html"
  done
As noted in a peer comment, the cat[0] command supports concatenating multiple files to stdout in one invocation.

HTH

EDIT: if you don't want the output file to be named "a.page.html" and instead it to be "a.html", replace the above cat invocation with:

  cat header.html "$PAGE" footer.html > "${PAGE%.page}.html"
This syntax assumes use of a POSIX/bash/zsh shell.

0 - https://man.freebsd.org/cgi/man.cgi?query=cat&apropos=0&sekt...

Re: Rewriting my website in plain HTML and CSS

#82

Earlier quoted context omitted.

> Yes, you must copy and paste content Manual work is almost never a good solution. Try this: for PAGE in *.page do cat header.html "$PAGE" footer.html > “$PAGE.html” done

`cat` supports multiple files, no? The whole point is that it concatenates. Why use 3 commands?

Oh man, cattiness use of cat!

Re: Rewriting my website in plain HTML and CSS

#83

Earlier quoted context omitted.

> Yes, you must copy and paste content Manual work is almost never a good solution. Try this: for PAGE in *.page do cat header.html "$PAGE" footer.html > “$PAGE.html” done

`cat` supports multiple files, no? The whole point is that it concatenates. Why use 3 commands?

Because I’m typing on my phone and the line was long. Thanks!

Re: Rewriting my website in plain HTML and CSS

#84

Earlier quoted context omitted.

Unfortunately that will require the client to make additional web requests to load the page, effectively doubling latency at a minimum.

Sounds like premature optimization for a simple page. If the objects are sized their regions should be fillable afterward without need to resize and be cached for subsequent access.

The other solutions are even easier and don’t double latency.

> be cached for subsequent access.

So now you need to setup cache control?

Re: Rewriting my website in plain HTML and CSS

#86

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…

How do you do for syntax highlighting ?

Re: Rewriting my website in plain HTML and CSS

#87
post #12

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…

GitHub was just down the other day. Why would you want your personal website/portfolio to be tied to GitHub? Crazy "modern web dev" stacks are likely overkill, but that's not an argument against self-hosting.

Because it's free and convenient, and other hosting providers don't magically have 100% uptime either. Not even necessarily more uptime than GitHub.

Re: Rewriting my website in plain HTML and CSS

#88

I decided to do write from scratch for my own site, and found that a real burden was maintaining lists of pages: there was no framework helping me out, and every time I added a new page I had to remember to go update my list of blog posts in the 2 or 3 pages I could access it from. To solve that and other issues, like adding an rss feed and letting pages specify their own publish date, I did what anyone would do: wri…

A few lines of PHP can solve that. The difference to other solutions is you don't have to compile/build/CI-CD it, just copy the PHP files in a folder, change a few things in the ini and you are ready to go.

For sure! PHP's a great language and tool! You'll still need a web server and modphp or something, and that web server was still probably compiled, but of course with bigger projects you can often get them from your distribution's package manager.

A little project like mine isn't the right answer for everyone; right now its only user is me. How it solves the problem fits my own little brain : )

Re: Rewriting my website in plain HTML and CSS

#89
Plain HTML and CSS personal site experience can be vastly improved by using server side includes. Your webserver's SSI module is likely just the right amount of templating power so you don't have to re-write the same HTML in $x spots with a minimal attack surface and maintenance burden. SSI hasn't changed in 20 years and the nginx module at least hasn't even ever had a cve.

    
    ...
    
This type of ssi templating is extremely useful for static HTML sites using .html (and other) files on filesystems. I've been using it since hosting my website on my 56k modem in 1999 with Xitami server on Win98. Now I do it hosting from my cable modem in 2025 with nginx on linux.

Re: Rewriting my website in plain HTML and CSS

#90
Hugo worked for me. And as part of the GitHub pipeline that builds the site and deploys it I can grab some ‘dynamic’ content (from a Notion DB) and render it. Subsequently I added Zapier so that when the Notion DB changes it triggers the pipeline to update my website. The only thing I pay for is the web hosting with dreamhost.

https://www.planetjones.net/blog/03-05-2023/relaunching-my-p...

Post reply on HN