Live data from Hacker News

Entire website in a single HTML file

css-tricks.com

121–130 of 333 posts

Re: Entire website in a single HTML file

#121

test

WTF - Why cant I reply to comments..

As thread depth increases, the "reply" link is delayed for an increasing time. This is one of HN's behavioural hacks at cooling off flamewars.

You can click on a comment directly to reply to it immediately. Use this knowledge with care.

Re: Entire website in a single HTML file

#122

Earlier quoted context omitted.

No JS here though, just CSS using :target. That's pretty cool if you don't want a JS dependency but want more control over interactivity and presentation.

Not to get too dramatic about this, but if you're that scared of any JS, why are you using the internet?

You're making vague gestures about something that is a specific issue these days. JS delivers all kinds of straight up garbage, some of it meant to do very ugly things, it can be turned off, tada, I'm still on the internet.

If people (like me) want to offer resources requiring none of that, why not encourage them, insofar as it makes the internet more efficient, a more helpful resource, and just way cooler in terms of chilling with all the crazy wasteful and annoying JS activity.

It's valid, relevant, and worthwhile. There's really no need to talk about being scared, as if this is some issue that requires a good talking to from dad.

Re: Entire website in a single HTML file

#124
post #41

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

Multiple displayed pages, and potentially an entire website, are presented within a single source file.

There are no^W^W is one external dependency (the stylesheet https://john-doe.neocities.org/style.css). This could also be inlined, and is required for the concept to work. There are 75 directives and/or media queries.

The site can be browsed entirely offline once accessed.

See also: https://news.ycombinator.com/item?id=29670168

Re: Entire website in a single HTML file

#125

Earlier quoted context omitted.

Nobody else is really doing this, or was doing this. But you can't tell that it's different, that's what's neat about it. It works just like a multi-page site but there's not even any JS requirement.

Been doing this for over half a decade off of a template I boosted 8 years ago and have been modifying since. Has made tens of millions in revenue. Just assumed every developer or template seller in south asia was using this - or their clients. Probably more common than you think.

Any examples you could point to?

Re: Entire website in a single HTML file

#126
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.

I don't know why they hide stuff, just show the whole site as a single page you can scroll down.

Information presentation has practical and usability aspects.

Sometimes you want as much information as possible on a page. Sometimes you want one and only one portion presented. Which you choose depends very much on the application, user community, and objectives.

Re: Entire website in a single HTML file

#127
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're describing PDF files, but unfortunately Adobe didn't invest much time or money into making them interactive with a scripting language.

> Adobe didn't invest much time or money into making them interactive with a scripting language.

yes they did. JavaScript, though I have no idea if there is a DOM or anything like it. pdf is kinda messed up in ways like that.

Re: Entire website in a single HTML file

#129
Well, TiddlyWiki[1] has been going it for 17(!) years. It's a very mature, polished, and extensible engine for wikis, blogs, and personal knwledge bases.

The entire thing (including the editor!) is a single .html file. By default, even images are embedded.

For my ADHD Wiki[2], a resource that talks about ADHD with a copious amounts of relatable memes intertwined with the text, I chose to just use images in the same directory instead of embedding them; so you might need to do some work to download that page (I think File -> Save as.. can give you a readable static version on some browsers).

Anyway, somewhat surprising that people are stumbling into how much you can do with just one well-crafted .html file. Look ma, no node.js, no (no)SQL database, no nothing except for one file for one website (and that file isn't even that large, given what TiddlyWiki allows you to do).

TiddlyWiki can be run on node.js, but I don't see much reason to. If I want to make changes, I use the built-in editor, and then the "Save..." button generates me the .html of the updated version. Save it over the old one, upload over ftp, done. No deployment process to speak of.

And, at that, the feature set rivals (and, at times, exceeds) that of, say, Wikipedia.

(And for math nerds: it supports LaTeX via a KaTeX plugin. Maybe you can't copy-paste your entire thesis, but it's pretty damn close to real-time full-featured LaTeX).

[1]https://tiddlywiki.com/

[2]https://romankogan.net/adhd

Re: Entire website in a single HTML file

#130

Earlier quoted context omitted.

You're describing PDF files, but unfortunately Adobe didn't invest much time or money into making them interactive with a scripting language.

The problem with PDF's has always been the layman can't create them without some expensive Adobe program.

macOS hasn’t had this problem in 20 years.
Post reply on HN