Live data from Hacker News

Entire website in a single HTML file

css-tricks.com

51–60 of 333 posts

Re: Entire website in a single HTML file

#53
post #8

This is something I've always wanted for virtual textbooks. A single .html file with all the JS, CSS, images as inline data blobs, etc. For most physics, math, CS, etc books, this should be possible. It would make it trivial to download the book for offline use and share it with others. Other than the raster images, the entire content of these types of books would probably fit in a couple MB of text. The use of #anch…

Isn't that what .epub is for?

Re: Entire website in a single HTML file

#54

One of the comments mentions a notable problem: Safari does not support 'Lazy' loading of images so every one they will be downloaded even if they are not seen.

While safari doesn’t support lazy it didn’t download the images until I clicked the link that had the images. Not sure exactly why, just weird.

Re: Entire website in a single HTML file

#56
post #8

This is something I've always wanted for virtual textbooks. A single .html file with all the JS, CSS, images as inline data blobs, etc. For most physics, math, CS, etc books, this should be possible. It would make it trivial to download the book for offline use and share it with others. Other than the raster images, the entire content of these types of books would probably fit in a couple MB of text. The use of #anch…

You can even embed images with a src converted to base64. This method even works well with the back/forward browser buttons, something that a naive show/hide JavaScript solution wouldn’t.

Or even store the whole page as a self-extracting zip file. This page is a zip file: https://gildas-lormeau.github.io/

Re: Entire website in a single HTML file

#57
post #11

Using url fragments seems to limit how well Google can index it. site:john-doe.neocities.org in a google search only finds the main page and dist page.

There’s only the main page, that’s the trick. Nothing else for Google to find.

Given one of the sections is a blog, that seems sub optimal.

Re: Entire website in a single HTML file

#59
post #8

This is something I've always wanted for virtual textbooks. A single .html file with all the JS, CSS, images as inline data blobs, etc. For most physics, math, CS, etc books, this should be possible. It would make it trivial to download the book for offline use and share it with others. Other than the raster images, the entire content of these types of books would probably fit in a couple MB of text. The use of #anch…

MHT did this 20 years ago and got all but abandoned (probably for good reasons).

Web bundles is supposed to replace it, cf. https://web.dev/web-bundles/

Re: Entire website in a single HTML file

#60
post #41

This looks like one of those sites I made as a kid. What is the significance of this?

Many people seeing this weren't alive when you were a kid.

I heavily encourage people constantly demonstrating how to competently do things using conventional systems.

I've gotten into many arguments over this stuff. Not that these simpler approaches don't work, but they lack the formality and theater.

Some people need to see stuff like this every day until they stop creating giant towers of spaghetti that don't do anything

Post reply on HN