Live data from Hacker News

Rewriting my website in plain HTML and CSS

vijayp.dev

31–40 of 218 posts

Re: Rewriting my website in plain HTML and CSS

#31
post #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]…

Adding validation/access control to server actions is pretty much the same as for API endpoints though?

I'm not sure next.js is the right fit for a blog/personal site either, but that's an odd point imo.

Your site looks very nice though!

Re: Rewriting my website in plain HTML and CSS

#32
As others have said, you are reinventing the Static Site Generator. I would strongly urge you to look into those.

If you know Python well enough, my recommendation is Pelican.[1] You can author your posts in Markdown. You specify the desired HTML/CSS. It will then do all the boring work for you. Then just upload the static files to a webserver.

[1] https://getpelican.com/

Re: Rewriting my website in plain HTML and CSS

#33
post #31
post #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]…

Adding validation/access control to server actions is pretty much the same as for API endpoints though? I'm not sure next.js is the right fit for a blog/personal site either, but that's an odd point imo. Your site looks very nice though!

[dead]

Re: Rewriting my website in plain HTML and CSS

#34
I have a pretty elaborate Hakyll site with custom routers and all kinds of junk (https://dpitt.me), but it's an old site that started as Django, then I built it from scratch with Sinatra, and then was Jekyll for years. There really is something special about a well-organized static site. For all the rewrites of this old thing, I can't imagine moving away from static site generation.

Re: Rewriting my website in plain HTML and CSS

#36
I do mostly the same, .md and pandoc, but also mo for templating:

https://github.com/tests-always-included/mo.

Took just a few minutes to setup. E.g. https://afarah.info/public/blog/awsv3/index.html.

Writing in Markdown with {{mustache}} templates for DRY is very satisfying, a simple bash script renders it. Looks good on my phone even.

Re: Rewriting my website in plain HTML and CSS

#37
This is exactly how I generate my site[^1]. Except I use a simple Node script to handle hosting a tiny HTTP server.

Node calls pandoc, which converts my markdown into HTML, ESBuild to convert the few JS snippets I run on my site (which I write in TS), and SASS to convert my scss stylesheet into a bundled CSS sheet.

It's super lightweight and I like that I can bend it to do whatever weird shit I want my site to have without relying on a 3rd party static site generator.

[^1]: https://pfy.ch

Re: Rewriting my website in plain HTML and CSS

#38
post #15
post #2

I'm surprised to not see Astro mentioned, its whole schtick is providing very similar DX to frameworks like SvelteKit except in a way that's geared towards generating plain HTML/CSS with zero JS by default. You get things like components with scoped styles but they are compiled down to nothing. It's really a breath of fresh air.

Once I randomly discovered Astro, I couldn't go back. I love that you can even drop in Svelte and React blocks right next to each other, so you basically the power of all the advanced frameworks, and the choice to pare it down to a barebones html static site

[deleted]

Re: Rewriting my website in plain HTML and CSS

#39
post #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 ;)

Does HTMX work without Javascript?

Re: Rewriting my website in plain HTML and CSS

#40

When I used to do interviews to frontend developers I often had them write a form with validation...in plain HTML and a sprinkle of js for some of the final validation touches. Was kinda surprised at how many senior leetcode blackbelts didn't know HTML had built in validation :) JS was required for some of the more complex validation logic and mounting few dom nodes (and again, surprisingly, many didn't know how to c…

HTML has built in validation, but the behavior and control over it is not great. I am using it in my projects to some extent, but it does not cover 100% of the needs. Because of that, some people skip it completely and almost forget it does exist.
Post reply on HN