Live data from Hacker News

Rewriting my website in plain HTML and CSS

vijayp.dev

161–170 of 218 posts

Re: Rewriting my website in plain HTML and CSS

#161
post #23

Did he reinvent a static-site generator? Markdown, pandoc, makefile... Sounds like a job for hugo/eleventy/jekyll/whatever.

I've tried Hugo and Jekyll a few times and they are pretty complicated. If you just want to post something online every now and then, then it might be easier to just to HTML.

Alternatively pick a light-weight template engine from your favorite language and use it to generate the html. More flexible than plain html files and very low learning commitment.

I've been doing that for years and really happy with the result.

Re: Rewriting my website in plain HTML and CSS

#162

There's a lot you can do with just plain html these days if you just need a clean site. Here's an example from my recipe site ( https://xilic.com/recipia/sauces/pesto_traditional.html ), mostly for my personal use or sharing with friends, with only html/css. It has expandable boxes, a menu system, etc. A simple script converts a directory structure of .csv files to these recipe cards with a template, and this way you…

Love the site! Usually desert = dry place and dessert = delicious food.

Re: Rewriting my website in plain HTML and CSS

#163
post #117

Earlier quoted context omitted.

> copy and paste content and not having layout page is annoying at times HTML was envisioned as an SGML application/vocabulary, and SGML has those power features, such as type-checked shared fragments/text macros (entities, possibly with parameters), safe third-party content transclusion, markup stream processing and filtering for generating a table of content for page or site navigation, content screening for remova…

I didn't expect this to be serious and am surprised on that the tutorial actually delivers. Way back when I was learning HTML and it was said that it was built with SGML, then this relation remained a total mystery to me.

> I didn't expect this to be serious and am surprised on that the tutorial actually delivers.

Same here. I believed that SGML was like Lisp of markup languages, except that it went completely extinct. Good to see it's still usable, I feel like I want to try it out now (instead of making a third generation of my static site generator from scratch).

Re: Rewriting my website in plain HTML and CSS

#164
Glad to hear you migrated to plain HTML and CSS, I think this creates a healthier environment: it removes bloat and is more efficient.

My question is how do you update your feed, sitemap and other stuff?

I've been doing it by shell scripts, I'm not 100% satisfied, I also create gemini pages from HTML, which changes content a lot.

Another question: how do you handle comments to your posts?

Because my blog is a static site, so there is no processing on the server end, and I don't want third parties to handle this. What I've done is adding a handler to my mail server, so it writes the mail sent to articles to the right place. And the HTML uses an to load them. I don't like it either, but works. Any suggestions for this things?

Thanks!

Re: Rewriting my website in plain HTML and CSS

#165
post #125

Earlier quoted context omitted.

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.

I don't particularly care about "designed for". If you've got to serve something to make the browser display the static content you want it to, the least unpleasant way to do so is with JS.

Least unpleasant to the developer. Most unpleasant to the user. It breaks all kinds of useful browser features (which frontend devs then recreate from scratch in JS, poorly; that's probably the most widespread variant of Greenspun's tenth rule in practice).

Re: Rewriting my website in plain HTML and CSS

#167

Earlier quoted context omitted.

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?

Nope and nope.

Re: Rewriting my website in plain HTML and CSS

#168
post #95

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.

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.

Re: Rewriting my website in plain HTML and CSS

#169

Glad to hear you migrated to plain HTML and CSS, I think this creates a healthier environment: it removes bloat and is more efficient. My question is how do you update your feed, sitemap and other stuff? I've been doing it by shell scripts, I'm not 100% satisfied, I also create gemini pages from HTML, which changes content a lot. Another question: how do you handle comments to your posts? Because my blog is a static…

>My question is how do you update your feed, sitemap and other stuff?

haven't tried this but maybe you could do that all in PHP and run `php feed.php > feed.html` or something regularly . and now I just realized you said you've been doing it with shell scripts and that's pretty much the same thing, maybe you could use a cron job or something.

I know a lot of people don't like PHP but I believe it's still the best/simplest way to just "make my HTML run code please". and it's improved a lot in recent years as well. of course if you want to use another language you can.

>Another question: how do you handle comments to your posts?

you could use something like Disqus or one of the alternatives. there are self hosted ones if you really don't trust third parties but then you might as well run the web server on there (and run PHP normally).

also just wondering how are you using for this?

Re: Rewriting my website in plain HTML and CSS

#170
post #10

Here's some of my tips for a handwritten HTML site, since the author wished more tips existed: - consider using an HTML boilerplate template like this one if you don't know where to start: https://www.matuzo.at/blog/html-boilerplate/ - consider using a CSS template, or a CSS reset, if you don't know where to start with styling. Pico CSS is a good drop-in: https://picocss.com/ . Frontend devs always blog about their C…

Great resources, cheers for this.

Totally forgot about CSS resets.

Post reply on HN