Live data from Hacker News

Rewriting my website in plain HTML and CSS

vijayp.dev

201–210 of 218 posts

Re: Rewriting my website in plain HTML and CSS

#201

Earlier quoted context omitted.

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 : )

You don't need a web server, for small stuff "php -S 8000" runs it for you.

Re: Rewriting my website in plain HTML and CSS

#202

Earlier quoted context omitted.

you mean npm packages? why would you need to update those anyhow?

Because at some point it will cease to work? It needs upgrades like any other project. Every upgrade in the JS world is very painful.

Why will they stop working eventually? Assuming they are all self contained and you don't upgrade even node js for that project

Edit: Oh right, OS upgrades could do it. Or network keys changing etc...

Re: Rewriting my website in plain HTML and CSS

#203

Earlier quoted context omitted.

you mean npm packages? why would you need to update those anyhow?

Because at some point it will cease to work? It needs upgrades like any other project. Every upgrade in the JS world is very painful.

Yeah I guess React + SSG isn't the best choice. Nano JSX might be better

https://nanojsx.io/

Re: Rewriting my website in plain HTML and CSS

#204
post #120

Earlier quoted context omitted.

Yes, it is. Unfortunately HN has a crazy bias against JavaScript (the least crazy part of the web stack) and in favour of HTML and CSS, even though the latter are worse in every meaningful way.

It isn't crazy, judging by the number of times I've seen posts here and on other blogs talking about a 100k web page ballooning to 8Mb because of all the Javascript needed to "collect page analytics" or do user tracking when ads are included. Granted that may not be needed for personal websites, but for almost anything that has to be monetized you're going to get stuck with JS cancer because some sphincter in a suit…

> I've seen posts here and on other blogs talking about a 100k web page ballooning to 8Mb because of all the Javascript needed to "collect page analytics" or do user tracking when ads are included

Perfect example. HN will see a page with 6Mb of images/video, 1Mb of CSS and 200Kb of JavaScript and say "look at how much the JavaScript is bloating that page".

Re: Rewriting my website in plain HTML and CSS

#206
post #24

Earlier quoted context omitted.

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

I recently learned the object tag can do what I wished for in the 90s... work as an include tag: Turn your back for twenty-five years, and be amazed at what they've come up with! ;-) Should reduce a lot of boilerplate that would get out of sync on my next project, without need for templating.

Hey, I need to try this out, so it is like iframe except the frame part and all its issues?

Re: Rewriting my website in plain HTML and CSS

#207
post #95

Earlier quoted context omitted.

A few extra in a blog post is a worthwhile tradeoff, if you're literally using raw HTML. - HTTP/1.1 (1997) already reuses connections, so it will not double latency. The DNS lookup and the TCP connection are a high fixed cost for the first .html request. - HTTP/2 (2015) further reduces the cost of subsequent requests, with a bunch of techniques, like dictionary compression. - You will likely still be 10x faster than…

Yes, I’d add that not merely “raw html” but a file on disk can be served directly by Linux without context switches (I forget the syscall), and transferred faster than generation.

sendfile? splice? io_uring?

Re: Rewriting my website in plain HTML and CSS

#208

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

Unfortunately, this doesn't adjust the element.

sed? :D

Re: Rewriting my website in plain HTML and CSS

#209
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.

I like to think that when GitHub (or Google, or Netflix, ...) are down, I am not alone.

A few million people are holding their breath - unlike in the case of my self-hosted site where I am alone to bring it back online.

Re: Rewriting my website in plain HTML and CSS

#210

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

Unfortunately, this doesn't adjust the element.

envsubst
Post reply on HN