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…
> HTML and CSS alone are really powerful https://html.energy/
Entire website in a single HTML file
211–220 of 333 posts
Re: Entire website in a single HTML file
#212Earlier quoted context omitted.
SPAs display in a single HTML URL, but are themselves (typically) comprised of multiple elements, including many CSS, JS, and data elements which are fetched dynamically. The example URL is a complete website within a single HTML document with no external dependencies and no further round-trip requests. It is a single-page site (SPS) or perhaps a multi-page file (MPF). https://john-doe.neocities.org/ You can open tha…
I've built React SPAs with inlined JS, CSS and SVGs in 2017, which is why I'm still entirely clueless what's special about this. BTW, the discussed page is not at all a single-page site; it makes separate network requests for CSS and PNG files.
The concept of an "SPA" refers to the appearance rather than provisioning of the app, and inherently relies on Javascript (or an equivalent scripting capability) to interactively rewrite the display. It's possible to single-file an SPA. The characteristic isn't central to the SPA concept, and in practice implementation is typically anything but.
SPAs are not accessible without Javascript, and don't render at all from a terminnal / console-mode browser. (Ask me how I know this...)
This is not an app. It's a website, or at least, multiple web pages, provisioned from a single HTML file.
Yes, this instance has several external references. I've noted CSS in an earlier comment, you mention image assets. The concept could be further optimised for portability by incorporating those inline.
Note that optimisations are also trade-offs. Inlined assets would mean duplication for a larger site. Which of those trade-offs are preferable or unwanted really depends on the specific goals.
But as a demonstration of an idea, this really is pretty elegant.
Re: Entire website in a single HTML file
#213Earlier quoted context omitted.
I have never understood why footnotes are added to the bottom when we have an interactive medium available at hand? Why not leverage and to show them in-place without breaking the flow and without listing them all at bottom? See your comment as an example. Why list all links at the bottom rather than in-place?
On HN it makes sense to me, because a long link would interrupt the flow of text. So you do a footnote to make them go out of the way. Otherwise Wikipedia has a happy medium I think; footnotes are on the bottom where you'd expect, but they show on hover so you don't have to jump there and then back.
Re: Entire website in a single HTML file
#214Earlier quoted context omitted.
On HN it makes sense to me, because a long link would interrupt the flow of text. So you do a footnote to make them go out of the way. Otherwise Wikipedia has a happy medium I think; footnotes are on the bottom where you'd expect, but they show on hover so you don't have to jump there and then back.
If only the Web had a way to make text clickable withtout showing the whole target URL.
Re: Entire website in a single HTML file
#215Earlier quoted context omitted.
On HN it makes sense to me, because a long link would interrupt the flow of text. So you do a footnote to make them go out of the way. Otherwise Wikipedia has a happy medium I think; footnotes are on the bottom where you'd expect, but they show on hover so you don't have to jump there and then back.
If only the Web had a way to make text clickable withtout showing the whole target URL.
Re: Entire website in a single HTML file
#216Earlier quoted context omitted.
If only the Web had a way to make text clickable withtout showing the whole target URL.
The reason is that trolls like to post links to shock sites or a google search for something terrible. Even worse, you could get rickrolled.
Re: Entire website in a single HTML file
#217Lovely article and such an interesting way of creating single page apps. I never knew about this usage of the :target selector. I think a major issue with this approach is just practicability - I'd want to write my content in something like markdown and we will anyway need JS to convert the markdown to HTML. I have also been interested in making SPAs, my my way is more traditional. Using javascript for the stitching.…
Re: Entire website in a single HTML file
#218Earlier quoted context omitted.
SPAs display in a single HTML URL, but are themselves (typically) comprised of multiple elements, including many CSS, JS, and data elements which are fetched dynamically. The example URL is a complete website within a single HTML document with no external dependencies and no further round-trip requests. It is a single-page site (SPS) or perhaps a multi-page file (MPF). https://john-doe.neocities.org/ You can open tha…
I've built React SPAs with inlined JS, CSS and SVGs in 2017, which is why I'm still entirely clueless what's special about this. BTW, the discussed page is not at all a single-page site; it makes separate network requests for CSS and PNG files.
Re: Entire website in a single HTML file
#219My 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
#220TIL about the :target pseudoselector. I've actually written JS to implement this functionality because i didnt know about it. embarrassed.