Earlier quoted context omitted.
> The gov.uk website completely eschews JavaScript at some usability cost I would imagine this was mostly driven by accessibility requirements more so than some ideological rigidity.
Unfortunately, some people view accessibility as an ideology.
No longer writing my own damn HTML
81–90 of 98 posts
Re: No longer writing my own damn HTML
#82Re: No longer writing my own damn HTML
#83Earlier quoted context omitted.
I only have 1 markdown editor, in nextcloud. Is there an app that let's me write markdown and then save as .md for publication by something that makes that HTML?
What do you mean markdown editor? I thought the idea was that you can just write it as plain text in something like notepad.exe
Re: No longer writing my own damn HTML
#84You actually skipped making an adhoc site generator of your own. Make a 5 line shell script to do steps 1 and 2 for your entire site. Then the content is just a few paragraph and link tags. Throw in a call to markdown if you want to get fancy.
Back in the day I'd use a WYSIWYG editor to design a front page and navbar and whatever, then split each part into header, nav, footer files and have code spit out the template HTML in the correct order with "body" file chosen by the URI This is static site generation? I had another name, basically it was CMS for people that used ms word to type blog posts Doing this again with a markdown step sounds cool I think a r…
Yeah can probably get a whole static site from a python script that loads jinja. There are lots of ways.
I just think this stuff is so easy and there is so many good tools that it is worth tailor making a solution you like.
Re: No longer writing my own damn HTML
#85Earlier quoted context omitted.
Back in the day I'd use a WYSIWYG editor to design a front page and navbar and whatever, then split each part into header, nav, footer files and have code spit out the template HTML in the correct order with "body" file chosen by the URI This is static site generation? I had another name, basically it was CMS for people that used ms word to type blog posts Doing this again with a markdown step sounds cool I think a r…
That’s the idea. But static site generation just means doing that templating before, so your site is a zip of html and assets. Yeah can probably get a whole static site from a python script that loads jinja. There are lots of ways. I just think this stuff is so easy and there is so many good tools that it is worth tailor making a solution you like.
Re: No longer writing my own damn HTML
#86Re: No longer writing my own damn HTML
#87A funky option for doing client-side includes and basic templating without JS is XSL. Here's an small demo I threw together https://github.com/evidlo/xsl-website A lot of people hate on XSL, but it has some interesting abilities!
I notice, for example, that this doesn't include a at the top, but it still functions because browsers accommodate incorrectly formatted HTML.
Re: No longer writing my own damn HTML
#88Earlier quoted context omitted.
Why would you need JS for any of that?
how else can I have a fullscreen overlay navigation on a phone from an accessible toggle button? almost forgot to answer the question: because I don't know any better
Unfortunately, accessible HTML solutions for well established UI patterns like menus and tooltips are still far too difficult to get right (anything that requires JavaScript usually).
Re: No longer writing my own damn HTML
#89Earlier quoted context omitted.
> However, I didn't like the idea of making the client side do work to make up for my own poorly-managed website. If you set the bar to "0% JS at all costs " then you can't very well complain about how hard it was to maintain HTML. Part of the standards, whether we like it or not, is JS. A sprinkling of JS (say, 60 lines?) to do client-side includes does not in any noticeable way increase the workload of the client,…
The argument is not to never use JS. The argument is that you shouldn't unnecessarily use JS in a way that breaks core functionality if it is disabled. There is no actual need solved by using client side include to load a nav bar. Doing so will break navigation on your blog for people without Javascript enabled. Even though it isn't talked about as much these days, progressive enhancement is still a really good idea.
I disagree: this[1] was such a dealbreaker that it caused the developer to literally switch stacks to get back the same feature.
When you find yourself switching stacks to get some feature, trust me, it's really needed.
> Even though it isn't talked about as much these days, progressive enhancement is still a really good idea.
Sure, and in this specific case all the dev had to do was include a link in each blog post to the root of the site `home`.
So when the JS is turned off the user can still navigate.
Once again, I am going to point out that plain HTML+CSS+JS is conformant to the relevant specifications; when a user wants to to, for whatever reason, deviate from the specification, they already know that most things won't work for them anyway!
IOW, you're not dealing with a clueless user who will wonder why the page has no navigation, you're dealing with someone who spent extra work and effort to get into the state they are, so they're already aware that most things don't work for them anyway!
But you responses throughout this thread is working on the assumption that megabytes of JS is required if you want client-side includes, and you coupled that with an implication that only incompetent developers would go down that route.
I can assure you, as a competent developer, that adding client-side includes with graceful degradation is maybe 60 lines of JS, cached, with no noticeable delays for the user.
If you think that the only options are a) Doing a full SPA with megabytes of JS, or b) No Javascript whatsoever, then I think that you're in no position to be calling other developers incompetent or lazy.
Re: No longer writing my own damn HTML
#90A funky option for doing client-side includes and basic templating without JS is XSL. Here's an small demo I threw together https://github.com/evidlo/xsl-website A lot of people hate on XSL, but it has some interesting abilities!
This is really neat, I didn't know the browser would serve a page that had been generated by XSL. Is this just a hack, or is it an intended feature? I notice, for example, that this doesn't include a at the top, but it still functions because browsers accommodate incorrectly formatted HTML.
> I notice, for example, that this doesn't include a at the top, but it still functions because browsers accommodate incorrectly formatted HTML.
I was just being lazy. I've added it now.