From 9f3d6b9df33ab61f818293af3ae6bcc28ef56714 Mon Sep 17 00:00:00 2001 From: Rohan Kumar Date: Fri, 17 Jun 2022 08:51:53 -0700 Subject: [PATCH] Re-introduce RSS discoverability alongside Atom The RSS feeds use escaped HTML instead of XHTML, which improves compatibility with certain feed readers (e.g. Microsoft Outlook). Mention that Outlook uses its own weird engine for feed contents in my web best practices article. --- content/_index.md | 3 ++- content/about/index.md | 1 + content/posts/website-best-practices.gmi | 18 ++++++++--------- content/posts/website-best-practices.md | 24 +++++++++++------------ layouts/_default/notes.html | 2 +- layouts/_default/rss.xml | 25 ++++++++++-------------- layouts/partials/posts.html | 2 +- 7 files changed, 36 insertions(+), 39 deletions(-) diff --git a/content/_index.md b/content/_index.md index 02262cb..f0d012a 100644 --- a/content/_index.md +++ b/content/_index.md @@ -3,6 +3,7 @@ outputs: - html - gemtext - atom + - RSS title: Seirdy's Home description: "Seirdy's Home: personal website and blog for Rohan Kumar, A.K.A. Seirdy. I write about and develop software to promote user autonomy." sitemap: @@ -23,7 +24,7 @@ About this site In addition to its [canonical url](https://seirdy.one), a "rough draft" of this website also exists on my [Tildeverse page](https://envs.net/~seirdy/ "{itemprop='sameAs' class='u-url' rel='me'}"). This site's content also appears on my [Gemini capsule](gemini://seirdy.one "{itemprop='sameAs' class='u-syndication' rel='me'}"). -This is a basic [IndieWeb site](https://indieweb.org/) that contains articles, notes, and bookmarks. You can subscribe to a combined feed of my articles and notes using [the site's Atom feed](./atom.xml), or you can subscribe to sections independently. +This is a basic [IndieWeb site](https://indieweb.org/) that contains articles, notes, and bookmarks. You can subscribe to a combined feed of my articles and notes using [the site's Atom feed](./atom.xml), or you can subscribe to sections independently. If your feed reader has problems displaying entry contents (I know Outlook does), I also have a legacy [RSS feed for the whole site](./index.xml) and for each section. About me -------- diff --git a/content/about/index.md b/content/about/index.md index afabcd5..f5b1105 100644 --- a/content/about/index.md +++ b/content/about/index.md @@ -174,4 +174,5 @@ This site is featured in some cool directories. - [Just Another Useless Page](https://www.geocities.ws/jaup/jaup.htm) - [Webrings Fanlisting](https://fanlistings.nickifaulk.com/webrings/) - [Gossip's Web](https://gossipsweb.net/personal-websites) +- [Nixers](https://github.com/nixers-projects/sites/wiki/List-of-nixers.net-user-sites) diff --git a/content/posts/website-best-practices.gmi b/content/posts/website-best-practices.gmi index d90f1d9..a628eaf 100644 --- a/content/posts/website-best-practices.gmi +++ b/content/posts/website-best-practices.gmi @@ -1418,17 +1418,18 @@ These tests begin reasonably, but gradually grow absurd. Once again, use your ju 8. Test keyboard navigability with the tab key and caret navigation. Even without specifying tab indexes, tab selection should follow a logical order if you keep the layout simple. 9. Test in textual browsers: lynx, links, w3m, ELinks, edbrowse, EWW, Netrik, etc. 10. Test in an online website translator tool. -11. Read the (prettified/indented) HTML source itself and parse it with your brain. See if anything seems illogical or unnecessary. Imagine giving someone a printout of your page's along with a whiteboard. If they have a basic knowledge of HTML tags, would they be able to draw something resembling your website? -12. Test with unorthodox graphical browser engines, like NetSurf, Dillo, Servo, or the Serenity OS browser. -13. Test how your page renders in ancient browsers, like Netscape Navigator or Tkhtml. Use a TLS terminator or serve over HTTP from localhost. -14. Try printing out your page in black-and-white from an unorthodox graphical browser. -15. Download your webpage and test how multiple word processors render and generate PDFs from it.¹⁴ -16. Combine conversion tools. Combine an HTML-to-EPUB converter and an EPUB-to-PDF converter, or stack multiple article-extraction utilities. Be creative and enjoy breaking your site. When something breaks, examine the breakage and see if it's caused by an issue in your markup, or a CSS feature with an equivalent alternative. -17. Build a time machine. Travel decades--or perhaps centuries--into the future. Keep going forward until the WWW is breathing its last breath. Test your site on future browsers. Figuring out how to transfer your files onto their computers might take some time, but you have a time machine so that shouldn't be too hard. When you finish, go back in time to meet Benjamin Franklin: +11. Test your feeds (RSS, Atom, JSON, etc.) in multiple readers to ensure they render your markup correctly. Microsoft Outlook uses Word's Internet-Explorer-based HTML engine to display these contents; Newsboat uses its own custom HTML renderer. Most don't support CSS. +12. Read the (prettified/indented) HTML source itself and parse it with your brain. See if anything seems illogical or unnecessary. Imagine giving someone a printout of your page's along with a whiteboard. If they have a basic knowledge of HTML tags, would they be able to draw something resembling your website? +13. Test with unorthodox graphical browser engines, like NetSurf, Dillo, Servo, or the Serenity OS browser. +14. Test how your page renders in ancient browsers, like Netscape Navigator or Tkhtml. Use a TLS terminator or serve over HTTP from localhost. +15. Try printing out your page in black-and-white from an unorthodox graphical browser. +16. Download your webpage and test how multiple word processors render and generate PDFs from it.¹⁴ +17. Combine conversion tools. Combine an HTML-to-EPUB converter and an EPUB-to-PDF converter, or stack multiple article-extraction utilities. Be creative and enjoy breaking your site. When something breaks, examine the breakage and see if it's caused by an issue in your markup, or a CSS feature with an equivalent alternative. +18. Build a time machine. Travel decades--or perhaps centuries--into the future. Keep going forward until the WWW is breathing its last breath. Test your site on future browsers. Figuring out how to transfer your files onto their computers might take some time, but you have a time machine so that shouldn't be too hard. When you finish, go back in time to meet Benjamin Franklin: => https://xkcd.com/567/ xkcd: Urgent Mission -I'm still on step 16, trying to find new ways to break this page. If you come up with a new test, please share it: +I'm still on step 17, trying to find new ways to break this page. If you come up with a new test, please share it: => mailto:~seirdy/seirdy.one-comments@lists.sr.ht Mailing list for this website @@ -1596,6 +1597,5 @@ I find Practical Typography quite useful for printed works, and incorporated a m ¹³ Consider disabling the JIT for your normal browsing too; doing so removes whole classes of vulnerabilities. In Firefox, toggle javascript.options.ion, javascript.options.baselinejit, javascript.options.native_regexp, javascript.options.asmjs, and javascript.options.wasm in about:config; in Chromium, run chromium with `--js-flags='--jitless'`; in the Tor Browser, set the security level to "Safer". ¹⁴ LibreOffice can also render HTML but has extremely limited support for CSS. OnlyOffice seems to work best, but doesn't load images. If your page is CSS-optional, it should look fine in both. -Fun fact: Microsoft Outlook renders HTML email with Microsoft Word's proprietary HTML engine. ¹⁵ Screen readers aren't alone here. Several programs strip inline formatting: certain feed readers, search result snippets, and textual browsers invoked with the `-dump` flag are some examples I use every day. diff --git a/content/posts/website-best-practices.md b/content/posts/website-best-practices.md index 21d20f5..2c3d079 100644 --- a/content/posts/website-best-practices.md +++ b/content/posts/website-best-practices.md @@ -1128,7 +1128,7 @@ On lists with many links, I had to find other ways to ensure adequate tap-target - The [webmention list](#webmentions) after this article separates links with timestamps and some paragraph spacing. -- Some list items have links with extra padding. These include description terms (`
`) and navigation elements, such as the table of contents or the site header and footer, +- Some list items have links with extra padding. These include description terms (`
`) and navigation elements, such as the table of contents or the site header and footer, - The [posts list](../../../../) and the list of related articles at the beginning of [one of my posts](../../../../2022/02/02/floss-security/) separates links with non-interactive text descriptions @@ -1152,7 +1152,7 @@ Line spacing (leading) is at least space-and-a-half within paragraphs, and parag {{}} Non-brow­sers: reading mode {#non-browsers-reading-mode} ------------------------------------- +-------------------------------------- Fully standards-compliant browsers aren't the only programs people use. They also use "reading mode" tools and services. @@ -1442,21 +1442,23 @@ These tests begin reasonably, but gradually grow absurd. Once again, use your ju 10. Test in an online website translator tool. -11. Read the (prettified and indented) HTML source itself and parse it with your brain. See if anything seems illogical or un­necessary. Imagine giving someone a printout of your page's `` along with a whiteboard. If they have a basic knowledge of HTML tags, would they be able to draw something resembling your website? +11. Test your feeds (RSS, Atom, JSON, etc.) in multiple readers to ensure they render your markup correctly. Microsoft Outlook uses Word's Internet-Explorer-based HTML engine to display these contents; Newsboat uses its own custom HTML renderer. Most don't support CSS. -12. Test with unorthodox graphical browser engines, like NetSurf, Dillo, Servo, or the Serenity OS browser. +12. Read the (prettified and indented) HTML source itself and parse it with your brain. See if anything seems illogical or un­necessary. Imagine giving someone a printout of your page's `` along with a whiteboard. If they have a basic knowledge of HTML tags, would they be able to draw something resembling your website? -13. Test how your page renders in ancient browsers, like Netscape Navigator or Tkhtml. Use a TLS terminator or serve over HTTP from localhost. +13. Test with unorthodox graphical browser engines, like NetSurf, Dillo, Servo, or the Serenity OS browser. -14. Try printing out your page in black-and-white from an unorthodox graphical browser. +14. Test how your page renders in ancient browsers, like Netscape Navigator or Tkhtml. Use a TLS terminator or serve over HTTP from localhost. -15. Download your webpage and test how multiple word processors render and generate PDFs from it.[^25] +15. Try printing out your page in black-and-white from an unorthodox graphical browser. -16. Combine conversion tools. Combine an HTML-to-EPUB converter and an EPUB-to-PDF converter, or stack multiple article-extraction utilities. Be creative and enjoy breaking your site. When something breaks, examine the breakage and see if it's caused by an issue in your markup, or a CSS feature with an equivalent alternative. +16. Download your webpage and test how multiple word processors render and generate PDFs from it.[^25] -17. Build a time machine. Travel decades---or perhaps centuries---into the future. Keep going forward until the WWW is breathing its last breath. Test your site on future browsers. Figuring out how to transfer your files onto their computers might take some time, but you have a time machine so that shouldn't be too hard. When you finish, go back in time to [meet Benjamin Franklin](https://xkcd.com/567/). +17. Combine conversion tools. Combine an HTML-to-EPUB converter and an EPUB-to-PDF converter, or stack multiple article-extraction utilities. Be creative and enjoy breaking your site. When something breaks, examine the breakage and see if it's caused by an issue in your markup, or a CSS feature with an equivalent alternative. -I'm still on step 16, trying to find new ways to break this page. If you come up with a new test, please [share it](mailto:~seirdy/seirdy.one-comments@lists.sr.ht). +18. Build a time machine. Travel decades---or perhaps centuries---into the future. Keep going forward until the WWW is breathing its last breath. Test your site on future browsers. Figuring out how to transfer your files onto their computers might take some time, but you have a time machine so that shouldn't be too hard. When you finish, go back in time to [meet Benjamin Franklin](https://xkcd.com/567/). + +I'm still on step 17, trying to find new ways to break this page. If you come up with a new test, please [share it](mailto:~seirdy/seirdy.one-comments@lists.sr.ht). {{}} {{< picture name="serenity" alt="Retro-looking browser with bitmap fonts showing this article's \"Code snippet 4\"." class="pix" sf=2 >}} @@ -1665,6 +1667,4 @@ A special thanks goes out to GothAlice for the questions she answered in # [^25]: LibreOffice can also render HTML but has extremely limited support for CSS. OnlyOffice seems to work best, but doesn't load images. If your page is CSS-optional, it should look fine in both. - Fun fact: Microsoft Outlook renders HTML email with Microsoft Word's proprietary HTML engine. - diff --git a/layouts/_default/notes.html b/layouts/_default/notes.html index 7fa57e9..95ff251 100644 --- a/layouts/_default/notes.html +++ b/layouts/_default/notes.html @@ -1,7 +1,7 @@ {{ define "main" -}}

Notes

-

This is my microblog, containing short informal entries. See my blog for longer entries. An An Atom feed contains the full text of all my notes.

+

This is my microblog, containing short informal entries. See my blog for longer entries. An An Atom feed contains the full text of all my notes. If that has any problems, I also have a legacy RSS feed.

Timestamp format: YYYY-MM-DD HH:MM:SS, as per RFC 3339. Sorted newest to oldest.

diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 75ea42d..086407b 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,31 +1,28 @@ -{{- $pctx := . -}} -{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}} -{{- $pages := slice -}} -{{- if or $.IsHome $.IsSection -}} -{{- $pages = $pctx.RegularPages -}} -{{- else -}} -{{- $pages = $pctx.Pages -}} -{{- end -}} +{{- $pages := (where site.RegularPages "Section" .Section) -}} {{- $limit := .Site.Config.Services.RSS.Limit -}} {{- if ge $limit 1 -}} {{- $pages = $pages | first $limit -}} {{- end -}} -{{- $currentSection := .Section -}} -{{- $type := "article" -}} {{- $period := "daily" -}} {{- $mins := "1440" -}} +{{- $title := .Section | humanize -}} {{- if eq .Section "notes" -}} - {{- $type = "note" -}} {{- $period = "hourly" -}} {{- $mins = "60" -}} {{- end -}} +{{- if .IsHome }} + {{- $period := "hourly" -}} + {{- $title = "All content" -}} + {{- $pages = .Site.RegularPages -}} + {{- $mins = "60" -}} +{{ end -}} {{- printf "" | safeHTML }} - {{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }} + {{ $title }} on {{ .Site.Title }} {{ .Permalink }} Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }} {{ $mins }} @@ -40,8 +37,7 @@ {{ with .OutputFormats.Get "RSS" }} {{ printf "" .Permalink .MediaType | safeHTML }} {{ end }} - {{ range where .Site.Pages "Kind" "page" }} - {{ if (eq .Section $currentSection ) }} + {{ range $pages }} {{ .Title }} {{ .Permalink }} @@ -51,6 +47,5 @@ {{- .Content | replaceRE `(?: )?(?:item(type|scope|prop|id|ref)="[^"]*"|class="language-figure")` "" | html -}} {{ end }} - {{ end }} diff --git a/layouts/partials/posts.html b/layouts/partials/posts.html index 0a809f8..22142ba 100644 --- a/layouts/partials/posts.html +++ b/layouts/partials/posts.html @@ -5,7 +5,7 @@ {{- if $isStandalone -}}

Posts

-

These are all of my long-form posts. An Atom feed contains the full text of all my posts.

+

These are all of my long-form posts. An Atom feed contains the full text of all my posts. If that has any problems, I also have a legacy RSS feed.

{{- else -}}

Posts