News for hackers. Stuff that matters.
Re:Show HN: A static site generator that prettifies the outp... by cantSpellSober on Wednesday March 27, 2024 @08:08AM (#39837984)
> Prettify all generated HTML (because why not?)

..because it makes the files larger? I see why it's useful during dev though. (Great name!)

Re:Show HN: A static site generator that prettifies the outp... by dlachausse on Wednesday March 27, 2024 @08:16AM (#39838042)
You see this concern about file size of websites all the time, but the extra white space is not what makes websites large, it’s all the images, fonts, and JavaScript libraries that get bundled with them. For most sites the HTML is negligible and compresses well if you enable GZip.
Re:Show HN: A static site generator that prettifies the outp... by chrisweekly on Wednesday March 27, 2024 @08:29AM (#39838153)
True. Also, for a typical web page, over 90% of user-perceived latency occurs AFTER the HTML has been fetched, unzipped, and parsed. That doesn't mean minification and compression are worthless, but it may help put things in perspective.
Re:Show HN: A static site generator that prettifies the outp... by cantSpellSober on Wednesday March 27, 2024 @08:48AM (#39838347)
Yep, I know images are big, fonts are evil and what gzip is.

Instead of "why not?" the author could sell the "why" there.

Re:Show HN: A static site generator that prettifies the outp... by djbusby on Wednesday March 27, 2024 @10:40AM (#39839820)
Soon as I saw the title I thought their "why" was: so it looks good when I view source.
Re:Show HN: A static site generator that prettifies the outp... by cantSpellSober on Wednesday March 27, 2024 @11:27AM (#39840550)
"why" in the repo, not the HN title
Re:Show HN: A static site generator that prettifies the outp... by dinkleberg on Wednesday March 27, 2024 @09:00AM (#39838476)
Not everything in life needs to be optimized.
Re:Show HN: A static site generator that prettifies the outp... by pfarrell on Wednesday March 27, 2024 @10:14AM (#39839412)
And not every optimization is worth the effort.
Re:Show HN: A static site generator that prettifies the outp... by cantSpellSober on Wednesday March 27, 2024 @10:26AM (#39839595)
In this case effort was required to remove the optimization.
Re:Show HN: A static site generator that prettifies the outp... by cantSpellSober on Wednesday March 27, 2024 @10:27AM (#39839614)
Nope! We weren't talking about "everything in life" but instead HTML in statically-generated websites.
Re:Show HN: A static site generator that prettifies the outp... by jkestner on Wednesday March 27, 2024 @12:31PM (#39841341)
I'd say, it's to optimize for source readability. That's something many of us relied on to learn HTML, and we need to keep that path open.
Re:Show HN: A static site generator that prettifies the outp... by Ylmaz on Wednesday March 27, 2024 @08:14AM (#39838036)
These pages should be served compressed anyways right? Then there will be no difference in size anymore.
Re:Show HN: A static site generator that prettifies the outp... by brainzap on Wednesday March 27, 2024 @08:11AM (#39838004)
I also format my blog HTML, I cant say why, but I want it to be tidy and readable.
Re:Show HN: A static site generator that prettifies the outp... by dlachausse on Wednesday March 27, 2024 @08:19AM (#39838066)
I think readability of HTML is something that people of a certain age just expect. I remember in the early days of the web just doing a “View Source” for interesting websites and learning a lot of really neat tricks to apply to my own websites.
Re:Show HN: A static site generator that prettifies the outp... by jjgreen on Wednesday March 27, 2024 @09:56AM (#39839155)
You should definitely do that at https://www.lingscars.com/
Re:Show HN: A static site generator that prettifies the outp... by jkestner on Wednesday March 27, 2024 @12:37PM (#39841408)
Wow, the presentation belies the nicely written source (excepting obfuscated JS). It's a depixelated love letter to 90s sites.
Re:Show HN: A static site generator that prettifies the outp... by filcuk on Wednesday March 27, 2024 @10:09AM (#39839329)
I can't tell if it's real or satire, but I like it (not in a visit ever again way)
Re:Show HN: A static site generator that prettifies the outp... by jjgreen on Wednesday March 27, 2024 @10:21AM (#39839517)
Real, as well as being a work of art.
Re:Show HN: A static site generator that prettifies the outp... by alxeder on Wednesday March 27, 2024 @09:41AM (#39838960)
the next generation is using devtools, inspect element
Re:Show HN: A static site generator that prettifies the outp... by dlachausse on Wednesday March 27, 2024 @09:48AM (#39839046)
Browser dev tools are incredible, but they just hit different than view source.

The web of the 90s and early 2000s was just so accessible as a kid curious about how it all worked. You could cobble together a personal website on Geocities and learn by copy and pasting code you found on someone else's website that did something cool. It just promoted this really beautiful experimentation and cross pollination of ideas that is mostly lost now.

Re:Show HN: A static site generator that prettifies the outp... by cantSpellSober on Wednesday March 27, 2024 @10:37AM (#39839766)
These add things that are missing (<html>, missing closing tags etc). Great for debugging but not the actual source.
Re:Show HN: A static site generator that prettifies the outp... by Retr0id on Wednesday March 27, 2024 @10:09AM (#39839328)
I'm a bit confused by this too. My static site generator also generates mostly-pretty HTML, but not because there's a prettification pass, it's just because the templates themselves are pretty (because I wrote them that way).

Surely the prettiness of the source that you actually edit is even more important than the final result?

Re:Show HN: A static site generator that prettifies the outp... by hunter2_ on Wednesday March 27, 2024 @11:25AM (#39840517)
> Surely the prettiness of the source that you actually edit is even more important than the final result?

A pretty final result can help with all sorts of future scenarios, like piping curl into grep for quickly checking if something exists. Similarly, I despise CSS preprocessing since figuring out a solution in the browser then has to be backported, hopefully with a source map to assist.

Re:Show HN: A static site generator that prettifies the outp... by Retr0id on Wednesday March 27, 2024 @11:29AM (#39840568)
Right, that's why I don't use minifiers. My pretty templates render to pretty HTML, with no additional prettification pass needed.
Re:Show HN: A static site generator that prettifies the outp... by forgotmyinfo on Wednesday March 27, 2024 @12:29PM (#39841318)
Gzip exists, and text compresses pretty well. Unless it's 20 MB of JavaScript just to render some text, that you're best just removing.