Rewriting my website in plain HTML and CSS
121–130 of 218 posts
Re: Rewriting my website in plain HTML and CSS
#122Recently 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]…
I looked at your site, and if that's anything more than a single static HTML file with some resources, served by a web server, something strange is going on. There is nothing complex on your site that requires more than a handful of lines of inline JS (to shuffle the letters).
The site also scrolls slowly, especially noticeable on phones. If this was just plain HTML it wouldn't.
It feels like the baseline for web developers has become that you MUST first add a ton of extremely complex dynamic stuff, and only then can you even think about putting a single line of text on the page. There's 200kB of code being loaded for this website, what is it doing?
Re: Rewriting my website in plain HTML and CSS
#123How is code syntax highlighting achieved in this context ?
You then see that it uses highlight.js
Re: Rewriting my website in plain HTML and CSS
#124Earlier quoted context omitted.
Isn't using React with a static site generator framework basically the same thing but better?
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.
Re: Rewriting my website in plain HTML and CSS
#125Earlier 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.
I don't even know where to begin with the pretence that you can compare HTML with JS and somehow conclude that one is 'better' than the other. They are totally different things. JS is for functionality, and if you're using it to serve static content, you're not using it as designed.
Re: Rewriting my website in plain HTML and CSS
#126I'm no front-end developer by any means, but arent native web components a thing now ?
https://developer.mozilla.org/en-US/docs/Web/API/Web_compone...
Re: Rewriting my website in plain HTML and CSS
#127With regard to templating approaches, my favorite by a very wide margin is to simply use string interpolation in the base language. You create a common template type with methods like: LayoutHtml(Session? Session, string title, string innerHtml, ...) => $@" (common elements) {innerHtml} (common elements) "; Which is then fed html partial snippets generated however you see fit. The use of methods to abstract partials…
Re: Rewriting my website in plain HTML and CSS
#128Earlier 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.
Re: Rewriting my website in plain HTML and CSS
#129Earlier 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…
Isn't using React with a static site generator framework basically the same thing but better?
Re: Rewriting my website in plain HTML and CSS
#130Did he reinvent a static-site generator? Markdown, pandoc, makefile... Sounds like a job for hugo/eleventy/jekyll/whatever.