Live data from Hacker News

Entire website in a single HTML file

css-tricks.com

141–150 of 333 posts

Re: Entire website in a single HTML file

#141

Earlier quoted context omitted.

Hum... You may be thinking about a page being a file. A site is a collection of those.

A site is a website is the thing behind a domain name. Many were, and are, a single file. Its the rest of ya'll that are overcomplicating things and somehow perverted that to thinking its necessary. How many layers of meta are we right now for this article to be interesting?

It’s probably your use of the word “normal” as it was more common for multi-page sites to either have a file per page or to use cgi.

Re: Entire website in a single HTML file

#143
post #84

HTML and CSS alone are really powerful. I decided not to use any JS on my personal site, but you can still have: + collapsible sections with `details` and `summary`[0] + footnotes, with navigation to/from with anchor tags. You can even apply CSS on the currently selected footnote.[1] + Semantic web that is compatible with everything and has sensible defaults so you can focus on what you're actually doing! + Tiny depl…

Can you filter some of the content based on say selected keywords? #physics on physics and … not sure even one can two keywords.

Re: Entire website in a single HTML file

#144

Why the fuck is this top of HN. I'm picturing way to many people viewing this today and thinking "Wow! Websites can be made without React? I will upvote!" Are we at a point where university Web101 classes just jump straight into SPAs?

Yes. There are a lot of devs that don't understand the fundamentals of how the web works.

The trending topic on front-end twitter last week was if you should even bother learning CSS or is only knowing Tailwind fine.

It's madness.

Re: Entire website in a single HTML file

#145

I love the simplicity of this so much, I built a whole CMS using that, with markdown and a single HTML file! https://github.com/arnaudsm/raito

The difference is they don't use javascript, a point many commenters apparently missed. This is similar how you can make drop-down header menus in css only - no javascript. Implementing css dropdown menus was one of my first big web dev tasks, since many users still had computers that slowed to a crawl when javascript and dom manipulation were involved.

I agree, I just went one step further to ease content management.

Re: Entire website in a single HTML file

#146
post #140

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.

PDFs actually have some support for javascript! I don't know any serious use for it and some PDF viewers refuse to support it (ex: Apple's Preview app), but it does exist.

Form verification for instance, if I remember correctly.

Re: Entire website in a single HTML file

#147

So to sum what I'm reading, it's a neat little demonstration of the :target pseudoclass. But: - No, the entire website isn't a single HTML file (it's also images and a CSS file) - So no, you can't download a single file and have it work offline - And no, this won't work well with screenreaders and other non-standard clients - And no, this doesn't scale well to larger sites - And no, this won't be indexed well by sear…

Just embed both CSS files and images in the HTML file.

Re: Entire website in a single HTML file

#148
My God, you mean it's possible to build a site that doesn't require 10MB of compressed stupid ass frameworks and preprocessors to turn your code into, uh, slightly different code? You can just... write HTML and CSS yourself? By hand? The deuce you say. :-D

Re: Entire website in a single HTML file

#150
post #147

So to sum what I'm reading, it's a neat little demonstration of the :target pseudoclass. But: - No, the entire website isn't a single HTML file (it's also images and a CSS file) - So no, you can't download a single file and have it work offline - And no, this won't work well with screenreaders and other non-standard clients - And no, this doesn't scale well to larger sites - And no, this won't be indexed well by sear…

Just embed both CSS files and images in the HTML file.

And now it's even less scalable to larger sites because you're forcing the eager loading of resources on pages you'll never click on.
Post reply on HN