Live data from Hacker News

My stack is HTML+CSS

blog.steren.fr

151–160 of 194 posts

Re: My stack is HTML+CSS

#152
post #126
post #28

Earlier quoted context omitted.

Twitter embeds are equally bad. Ended up remaking them to output static HTML + CSS to improve perf ( https://leerob.io/tweets ).

Same, I get ~500 tweets displayed with: - No JavaScript necessary - All profile images turned into one massive sprite - Minimal payload size Here are what the tweets look like when rendered: https://umaar.com/dev-tips/feedback Here's the code to achieve that: https://github.com/umaar/better-twitter-embed

Well done, thanks for sharing!

Re: My stack is HTML+CSS

#153
post #35

Those poor Lighthouse scores are what you get when you put no work into refining your site's performance. This is especially true for an out-of-the-box Wordpress implementation. I have a React project with 100s across the board, but I wouldn't necessarily recommend a React implementation if high performance is key. This doesn't even touch upon the topic of good developer performance, which is just as important as a s…

The site still fails Lighthouse, including the test for "Includes front-end JavaScript libraries with known security vulnerabilities." But wait, I thought it was just HTML and CSS!

> The site still fails Lighthouse

No it doesn't. Are you sure something on your system isn't injecting JavaScript (browser extension?)

Re: My stack is HTML+CSS

#154
post #46
post #21

This is an inaccurate over-simplification. If you just use HTML and CSS, you can also have really bad Lighthouse scores. For example, vanilla ` ` will ship the same image to every device, regardless of viewport size. Vanilla ` ` doesn't enforce setting `width` and `height`, which makes your layouts shift. Slow-loading images and layout shifts are the very things that will downgrade the "100" score he's currently prou…

> Vanilla ` ` will ship the same image to every device, regardless of viewport size. You can have responsive images with vanilla [0]. You can even lazy load images with just `loading="lazy"` attribute[1]. I'm pretty sure I can optimize more things. I'm mostly agree with this blog post. Plain HTML+CSS is really good for simple webpages, like landing page or portfolio that requires less update. But for a blog with pagi…

Also sending binary images and rendering them is very light-weight. They are also cache friendly (doesn't change often).

Re: My stack is HTML+CSS

#155
post #72
post #66

Sure, it's super easy when your page doesn't have even a header and/or a footer. Try having a top-menu in your design, or some banners/ads, and then you need to change ALL the pages to change a single url. This is how we used to do things long time ago, and it sucked BIG TIME, and that's why people invented server-side includes and cgi and mod_php and all of that... it saves time, and your time costs much more than h…

My article covers that: > So... if I don’t use any templating system, how do I update my header, footer or nav? Well, simply by using the ”Replace in files” feature of any good text editor. They don’t need frequent updates anyway. The benefits of using a templating system is not worth the cost of introducing the tooling it requires.

[deleted]

Re: My stack is HTML+CSS

#156
post #70

The main issues are the ergonomics of authoring and maintaining consistency around a site. A minimal static site generator would keep internal links and boilerplate consistent. Connecting that with markdown, Org mode, or reStructured Text would help with the ergonomics. But then you lose the goal of having no necesary tools. Anyhow, if there's one general purpose tool that predates the web and will probably be around…

> A minimal static site generator would keep internal links and boilerplate consistent. Maybe not. There's an argument to be made that says you should treat a blog as a series of pages, each modeling something corresponding to what you might call a "publication event" in the real world, e.g. printing a magazine or passing around a physical memo. The consistency angle is probably overvalued (not worth its cost). When…

OK, but blogging isn't the only type of site you might manage like this. Documentation, for example, you want to update your links properly when you change the name of a function or whatever. Or perhaps you have a catalog naming files by SKU and those can change.

And, if you're just blogging, and you want to have the permanence you're talking about, you still need to ensure that all your links are properly linked, which requires some tooling.

Re: My stack is HTML+CSS

#157
I'm also a huge fan of keeping things simple. But there is a reason we are having this conversation here, and not in the comments section of his blog.

Comments are something I consider pretty vital to even a basic blog now. And so he's kind of missed the mark for me.

Re: My stack is HTML+CSS

#158
post #114

Earlier quoted context omitted.

To be fair, static site generators are a thing and are very much underused in cooperations. He could have the same scores/performance and still get the full advantages you mentioned. But yes, handcrafting html is pointless at some point, especially if you have to update the contents every so often

He mentions that SSGs require tooling and dependencies. And if all you need are dynamic headers and footers, just wrap those in 'php include' tags and rename the files to .php. It's still HTML and CSS that's getting rendered.

I've used both server side rendering and server side includes. A static site generator beats both. Just have a listener that will re-generate the site live when you write new content, then just ssh/ftp the generated content to the server when you are done, or if you are fancy you can use version control and push to a repo with a CI toolchain that will regenerate and ssh/ftp it for you.

Re: My stack is HTML+CSS

#159
post #66

Sure, it's super easy when your page doesn't have even a header and/or a footer. Try having a top-menu in your design, or some banners/ads, and then you need to change ALL the pages to change a single url. This is how we used to do things long time ago, and it sucked BIG TIME, and that's why people invented server-side includes and cgi and mod_php and all of that... it saves time, and your time costs much more than h…

to cover slightly more use cases, you could go for like it's 2002, and then have that file just be plain html also. Of course if you're gonna pitch a solution that's impractical in most cases, you might as well go for the most extreme variant of that solution and not bother with that

Re: My stack is HTML+CSS

#160
post #21

This is an inaccurate over-simplification. If you just use HTML and CSS, you can also have really bad Lighthouse scores. For example, vanilla ` ` will ship the same image to every device, regardless of viewport size. Vanilla ` ` doesn't enforce setting `width` and `height`, which makes your layouts shift. Slow-loading images and layout shifts are the very things that will downgrade the "100" score he's currently prou…

Back in the day you sized your image for the web, there was no need for dimensions in img tags > For example, vanilla ` ` will ship the same image to every device, As it should be, for simplicity's sake. Designers trying to assert pixel-perfect control of layout is part of why the web sucks so much today. Let the browser handle layout, that is one of the things it is designed to do!

[deleted]
Post reply on HN