News for hackers. Stuff that matters.
Re:Entire website in a single HTML file by tyre on Thursday December 23, 2021 @10:30PM (#29669812)
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 deploys and page loads. Single KBs (with brotli compression) for long blog posts. Just `scp` and Nginx keeps serving.

I can't think of anything else I want. And when I think of it, I can probably build it on top.

[0]: https://maddo.xxx

[1]: https://maddo.xxx/thoughts/an-introduction-to-product-strate...

Re:Entire website in a single HTML file by mathnmusic on Friday December 24, 2021 @01:43AM (#29671005)
I have never understood why footnotes are added to the bottom when we have an interactive medium available at hand? Why not leverage <details> and <summary> 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?

Re:Entire website in a single HTML file by npteljes on Friday December 24, 2021 @03:47AM (#29671693)
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 by outadoc on Friday December 24, 2021 @04:10AM (#29671845)
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 by marginalia_nu on Friday December 24, 2021 @08:15AM (#29673299)
I find inline links incredibly disruptive to my reading flow, the change in color makes my eyes start jumping around in the text. Wikipedia especially is absolutely hopeless, to the point where I've built a mirror that removes all inline links. (A page looks like this: https://encyclopedia.marginalia.nu/wiki/Hyperlink )
Re:Entire website in a single HTML file by anigbrowl on Tuesday December 28, 2021 @08:06PM (#29720440)
Just make it the same color. For me links on HN are underlined but the same color as regular text or a slightly dimmer gray if already visited. It's one of the first things I do when I install a new browser and if it's hard that browser doesn't stay installed long.
Re:Entire website in a single HTML file by breggles on Friday December 24, 2021 @10:19AM (#29674260)
Just found this FF add-on [1], yesterday, which removes all links from a page. Works reasonably well. Can also invoke reader view after removing links and get the benefits there.

[1] https://addons.mozilla.org/en-GB/firefox/addon/nolinks/

Re:Entire website in a single HTML file by efreak on Saturday December 25, 2021 @03:23PM (#29686638)
Wouldn't a user script work just as well for this purpose? `document.querySelectorAll('a').for each(a=>{a.outerHTML=a.innerHTML});`
Re:Entire website in a single HTML file by marginalia_nu on Saturday December 25, 2021 @03:39PM (#29686754)
Sure, that works too. You still get the megabyte pageloads though, and you need to carry the script with you every where you go.
Re:Entire website in a single HTML file by bananamerica on Friday December 24, 2021 @09:05AM (#29673652)
Looks good. A bit out of date though
Re:Entire website in a single HTML file by marginalia_nu on Friday December 24, 2021 @07:10PM (#29679042)
Yeah, I think the there is a new data dump available, will rebuild the html files from that soon.
Re:Entire website in a single HTML file by npteljes on Friday December 24, 2021 @04:52AM (#29672154)
There must be other reasons, if it doesn't make sense technologically, no? Instagram also has the tech to show more than 3 images in a row, and Twitter could allow longer texts if they wanted so.
Re:Entire website in a single HTML file by zaphirplane on Friday December 24, 2021 @05:45AM (#29672476)
Sarcasm acknowledged

Hiding in the URL is a favorite feature for scams and pranks

Re:Entire website in a single HTML file by dncornholio on Friday December 24, 2021 @04:22AM (#29671936)
The technology just isn't there yet.
Re:Entire website in a single HTML file by Flankk on Friday December 24, 2021 @04:24AM (#29671955)
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 by kreeben on Friday December 24, 2021 @04:33AM (#29672029)
Some day we will have native browser support for the full URL showing in the status field.
Re:Entire website in a single HTML file by zaphirplane on Friday December 24, 2021 @05:56AM (#29672540)
Oh no cried the scammers, how will we ever again trick people into clicking a link
Re:Entire website in a single HTML file by johannes1234321 on Friday December 24, 2021 @10:23AM (#29674302)
window.status to the rescue! We must override the long scam URL there!
Re:Entire website in a single HTML file by tcmart14 on Sunday December 26, 2021 @01:23AM (#29690225)
Just wanted to say, the best part was acknowledging the worst was being rickrolled. xD
Re:Entire website in a single HTML file by chrismorgan on Friday December 24, 2021 @05:14PM (#29678276)
I think endnotes are typically an awful idea, and the web can’t do footnotes. What you want is generally side notes. I think what I do on my website is a fairly good compromise for JavaScript-free operation, with a side column for notes on large enough screens, and the notes inlined on small screens. That wouldn’t be suitable for very long notes; such are often more suitable as appendixes, a variant on endnotes.

As for <details>, you run into the problem that it’s a block-level element; it’s dubious using it as an inline-level element, though it’ll probably work well enough (I say probably due to uncertainty about screen readers) despite being nominally invalid, given that it’s not an element that will automatically close a paragraph tag like <div> does.

I think links at the bottom is generally foolish, taking more effort for both reader and writer, and never do it that way, interspersing them in the text, usually surrounded by angle brackets as has historically been the way of delimiting URLs in plain text.

Re:Entire website in a single HTML file by gjvnq on Friday December 24, 2021 @02:08AM (#29671126)
On my website, I ise margin notes for the desktop and "footnotes" for mobile, however said footnotes are displayed just below the paragraph in which they appear.

This avoids requiring both long scrolling and interactivity.

Re:Entire website in a single HTML file by gnubison on Saturday December 25, 2021 @12:25AM (#29680722)
Do you think you could elaborate on how this works? It seems like a very ergonomic alternative to traditional footnotes.
Re:Entire website in a single HTML file by tyre on Friday December 24, 2021 @02:03AM (#29671102)
Good question.

For my site, there are other options that I'd like to explore. Tooltips for smaller things (like definitions) maybe sidebar notes for large screen sizes, and inline notes (like show/hide inserting it between that line and the next) for mobile.

I'll look into those.

Re:Entire website in a single HTML file by mathnmusic on Friday December 24, 2021 @02:14AM (#29671163)
I like how the site being discussed implements footnotes with a hidden checkbox followed by <small> tag: https://john-doe.neocities.org/
Re:Entire website in a single HTML file by layer8 on Friday December 24, 2021 @08:17AM (#29673309)
> Why not leverage <details> and <summary> to show them in-place

Searchability. You want footnote content to be Ctrl+F-able.

Re:Entire website in a single HTML file by johannes1234321 on Friday December 24, 2021 @10:24AM (#29674308)
A smart browser could understand footnotes and show them in searches.
Re:Entire website in a single HTML file by Spivak on Sunday December 26, 2021 @05:32PM (#29696993)
You gotta dance with the browser that brought you though. Unless you plan to never publish you’ve gotta design the best interface you can with the constraints of your real users.
Re:Entire website in a single HTML file by nawgz on Friday December 24, 2021 @12:36AM (#29670618)
Ah, <details> and <summary>. The most glorious HTML5 elements of them all. Use and abuse these for all sorts of custom yet native capabilities, like <select>s with custom styles and proper keyboard/native controls.
Re:Entire website in a single HTML file by wishinghand on Thursday December 23, 2021 @11:05PM (#29670052)
I’d want templating if I’m going to make more than two pages on a site.
Re:Entire website in a single HTML file by onion2k on Friday December 24, 2021 @02:27AM (#29671235)
HTML has that built in: https://developer.mozilla.org/en-US/docs/Web/Web_Components/...

You'd need some JS to make use of them though.

Re:Entire website in a single HTML file by Spivak on Sunday December 26, 2021 @05:36PM (#29697027)
This honestly looks like a huge PITA compared to even the worst static site generator’s syntax. Is this actually supposed to be used as end-developer templates?
Re:Entire website in a single HTML file by wishinghand on Friday December 24, 2021 @06:16PM (#29678718)
True, but keeping to the spirit of the comment I replied to, I’d prefer it to be HTML only. Something like <template src=“header.html”> and it just uses a relative or absolute path.
Re:Entire website in a single HTML file by JonathanBuchh on Friday December 24, 2021 @01:42AM (#29670998)
Static site generators like Jekyll and Hugo are perfect for this :)
Re:Entire website in a single HTML file by danlugo92 on Thursday December 23, 2021 @11:40PM (#29670282)
You can run React (and everything else) off a CDN.
Re:Entire website in a single HTML file by rmbyrro on Friday December 24, 2021 @04:33PM (#29677948)
React runs in the browser. You probably mean serve the files off a CDN
Re:Entire website in a single HTML file by danlugo92 on Wednesday January 05, 2022 @01:06PM (#29812627)
Yeah that's what I meant.
Re:Entire website in a single HTML file by tentacleuno on Saturday December 25, 2021 @06:26PM (#29688036)
It can also run in the server with Server Side Rendering[0]. I believe some CDN's also offer support for this, too.

[0]: https://reactjs.org/docs/react-dom-server.html

Re:Entire website in a single HTML file by culi on Thursday December 23, 2021 @10:42PM (#29669893)
> HTML and CSS alone are really powerful

https://html.energy/

Re:Entire website in a single HTML file by phist_mcgee on Friday December 24, 2021 @12:43AM (#29670660)
> Written in pure, raw HTML. Can you feel the energy?

Has several CSS files (one 2.5 Kb) and a 13Kb minified js file (https://www.statcounter.com/counter/counter.js) that does... something related to user tracking.

I don't get it.

Re:Entire website in a single HTML file by 8bitsrule on Friday December 24, 2021 @03:48AM (#29671697)
The Patreon page isn't HTML. Guess there are limits.
Re:Entire website in a single HTML file by Lorin on Friday December 24, 2021 @04:05AM (#29671815)
getting zombocom vibes
Re:Entire website in a single HTML file by adabaed on Thursday December 23, 2021 @10:46PM (#29669926)
You like to live in hard mode. I like that.
Re:Entire website in a single HTML file by southerntofu on Friday December 24, 2021 @06:58AM (#29672891)
Building a website in raw HTML/CSS is much easier than the equivalent in javascript-framework-du-jour. It's also much lighter on resources both on server and client. It's a win-win situation for everyone, especially for clients with less powerful computers.
Re:Entire website in a single HTML file by CoryAlexMartin on Friday December 24, 2021 @12:38AM (#29670639)
Building a website without JS is not hard.
Re:Entire website in a single HTML file by adabaed on Friday December 24, 2021 @01:38AM (#29670973)
Depends of what a website is for you.
Re:Entire website in a single HTML file by dmitriid on Friday December 24, 2021 @02:48AM (#29671351)
The same it is for everyone since the beginning of WWW: a static page with images. The web is uniquely unsuitable for anything else.
Re:Entire website in a single HTML file by cutler on Friday December 24, 2021 @03:54AM (#29671734)
So forget e-commerce? Amazon didn't do too badly and CGI was hot on the heels of HTML so I think "everyone" is a little exaggerated.
Re:Entire website in a single HTML file by dmitriid on Friday December 24, 2021 @04:00AM (#29671781)
> So forget e-commerce?

Says (s)he and immediately follows up with

> Amazon didn't do too badly

Re:Entire website in a single HTML file by cutler on Friday December 24, 2021 @09:20PM (#29679744)
My point is that the WWW was a lot more than static HTML and CSS pretty soon after its inception.
Re:Entire website in a single HTML file by dmitriid on Saturday December 25, 2021 @02:51AM (#29681347)
You're confusing displaying different information at different URLs with being "more than static HTML and CSS".
Re:Entire website in a single HTML file by TomGullen on Friday December 24, 2021 @06:18AM (#29672662)
This is a very old fashioned point of view I’m afraid, things have moved on.
[dead]
Re:Entire website in a single HTML file by adabaed on Friday December 24, 2021 @06:23PM (#29678760)
I know enough to don't feel the need to demonstrate a random guy in a forum that I know more about a topic.
Re:Entire website in a single HTML file by The_suffocated on Friday December 24, 2021 @02:48AM (#29671355)
May I ask how to create a Mathematics Stack Exchange clone without JS?
Re:Entire website in a single HTML file by adabaed on Friday December 24, 2021 @03:06AM (#29671445)
PHP and cocaine.
Re:Entire website in a single HTML file by est on Friday December 24, 2021 @09:33AM (#29673878)
In the past Latex symbols were rendered on server as an image.

It was not pretty but it works virtually anywhere.

Re:Entire website in a single HTML file by jhgb on Friday December 24, 2021 @05:26AM (#29672369)
What part of a Mathematics Stack Exchange clone would require JS?
Re:Entire website in a single HTML file by tazjin on Friday December 24, 2021 @06:36AM (#29672765)
In "modern" stacks it is preferable to do things like layouting of formulas millions of times on the clients, instead of once on the server. I guess that sort of thing needs JS.
Re:Entire website in a single HTML file by southerntofu on Friday December 24, 2021 @06:57AM (#29672883)
As you have pointed out, but formulated more explicitly: client-side rendering should deal only with HTML/CSS because that's what the browser is built and optimized for. Every line of script changing the DOM (html structure) may trigger a redraw of the page, which means wasting considerable amount of resources! But even if your script outputs HTML only once, you still have O(n) HTML templating instead of O(1) for n clients. Such a waste!
Re:Entire website in a single HTML file by The_suffocated on Friday December 24, 2021 @11:26AM (#29674868)
The MathJax part.
Re:Entire website in a single HTML file by jhgb on Friday December 24, 2021 @05:46PM (#29678506)
MathJax is somewhat convenient but doesn't seem necessary at all.
Re:Entire website in a single HTML file by unbanned on Friday December 24, 2021 @05:10AM (#29672271)
Completely agree
Re:Entire website in a single HTML file by rambambram on Friday December 24, 2021 @03:50AM (#29671710)
How old are you?
Re:Entire website in a single HTML file by samus on Friday December 24, 2021 @03:49AM (#29671706)
~~With progressive enhancement, you could arrange to display only the current subpage. When Javascript is off, the whole page would render as a long-ish HTML document. Which is indeed no issue at all with the sitemap in a sidebar.~~

Edit: I obviously didn't read the article...

Re:Entire website in a single HTML file by mcovey on Saturday December 25, 2021 @02:30PM (#29686211)
One suggestion, set the overflow to "scroll" so the scrollbar is always visible. When I open a section it appears, adding like 10px on the right and all the content moves left.
Re:Entire website in a single HTML file by rhgg on Thursday December 23, 2021 @10:53PM (#29669980)
Thanks for sharing, beautiful site. Great typography.
Re:Entire website in a single HTML file by ngcc_hk on Friday December 24, 2021 @01:04AM (#29670776)
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 by 6510 on Friday December 24, 2021 @01:48AM (#29671028)
#physics:target #section-1, #physics:target #section-2{display:block}

then wrap the sections in <div id="physics">

Re:Entire website in a single HTML file by authed on Thursday December 23, 2021 @11:17PM (#29670127)
nice. most sites that use javascript don't need to... https://i.imgur.com/qaJYWit.png
Re:Entire website in a single HTML file by a_t48 on Thursday December 23, 2021 @11:41PM (#29670288)
I’m not sure that Google Maps is the best example of something that should work well without JS.
Re:Entire website in a single HTML file by authed on Friday December 24, 2021 @08:35AM (#29673431)
True, but even Google Maps could work without Javascript... It may not be as easy to use without it though.
Re:Entire website in a single HTML file by pge on Friday December 24, 2021 @10:20AM (#29674269)
I still remember the first time I used google maps. It was the first example I ever saw of what was then called AJAX, and it blew my mind. Without javascript, google maps would have been the same as mapquest (or any other mapping sites from that era): a full page refresh to move or zoom on the map. Javascript was the differentiator that made google maps the winner.
Re:Entire website in a single HTML file by authed on Friday December 24, 2021 @02:56PM (#29677152)
I'm not saying the experience is as good, but sometimes you need or want to browse without Javascript (at least some people).
Re:Entire website in a single HTML file by eatYourFood on Friday December 24, 2021 @03:09AM (#29671462)
Did you manage to sell Romulus to any gov customers? I built and sold a similar solution on top of SAP Hybris which we sold to several government departments around the world. It’s a very hard sell even with the worlds largest software sales organisation behind you.
Re:Entire website in a single HTML file by tyre on Friday December 24, 2021 @11:15AM (#29674768)
We did, yes.

The start was in political offices, which need CRMs and are motivated to move or they're fired. Constituent service satisfaction is one of the top indicators of being re-elected.

Moving into permanent government departments is more of a pain but we did see some success there.

Ultimately, though, the trough between early-adopters and getting mainstream is dishearteningly deep and there aren't enough ealry-adopters to build momentum. Not for us anyway.