Skip to content

Localization: add per-language Atom feeds - #2935

Open
bittomhan wants to merge 196 commits into
bitcoinops:masterfrom
bittomhan:feat/language-feeds-285-251
Open

bittomhan wants to merge 196 commits into
bitcoinops:masterfrom
bittomhan:feat/language-feeds-285-251

Conversation

@bittomhan

Copy link
Copy Markdown
Contributor

The site has eight translated languages but one feed, and the auto-discovery link emitted for every page pointed at the English one, so subscribing from /ja/blog/ or /zh/newsletters/ gave English content.

Changes:

  • _includes/functions/atom-feed.xml: the Atom body, parameterized by language, feed path, home path and entry limit.
  • feed.xml: thin wrapper around it. English output is unchanged apart from xml:lang="en" and hreflang="en".
  • Eight new feeds: /zh/, /ja/, /de/, /es/, /fr/, /pt/, /cs/, /hi/.
  • _includes/head.html: the discovery link now points at the feed for page.lang (replaces {% feed_meta %}, which cannot vary per page).
  • _includes/functions/rss-subscribe.md plus the blog/newsletters/publications layouts: the subscribe line is no longer English-only.

Testing (clean build):

  • Eight feeds generated; entry counts zh/ja/de/fr/cs/hi 10 each, es 2, pt 1.
  • Every entry in a language feed links to a page under that language.
  • The English feed is byte-identical to master after normalizing whitespace and the two added attributes.
  • htmlproofer: 28,168 internal links, no errors.

Closes #285. Refs #251 — the language-selector graphics item there is still open.

bittomhan and others added 30 commits February 28, 2024 10:48
Co-authored-by: Zhiwei(Jeffrey) Hu <huzhiwei@outlook.com>
Co-authored-by: Zhiwei(Jeffrey) Hu <huzhiwei@outlook.com>
Co-authored-by: Zhiwei(Jeffrey) Hu <huzhiwei@outlook.com>
Co-authored-by: Zhiwei(Jeffrey) Hu <huzhiwei@outlook.com>
Co-authored-by: Zhiwei(Jeffrey) Hu <huzhiwei@outlook.com>
bittomhan added 27 commits March 2, 2025 06:26
The site has eight translated languages but only one feed, and the
auto-discovery <link> emitted for every page pointed at the English feed.
Readers of /ja/, /zh/, etc. who used their reader's "subscribe" button
therefore got English content (issues bitcoinops#285 and bitcoinops#251).

Move the Atom body into _includes/functions/atom-feed.xml, parameterized by
language, feed path and home path.  feed.xml becomes a thin wrapper, and
each translated language gets /<lang>/feed.xml.  The <link> in head.html and
the "subscribe via RSS" line in the blog, newsletters and publications
layouts now point at the feed for the page's own language.

Verified: eight feeds are generated (zh/ja/de/fr/cs/hi: 10 entries each,
es: 2, pt: 1); every entry in a language feed links to a page under that
language; the English feed is unchanged apart from the addition of
xml:lang="en" and hreflang="en"; htmlproofer passes on 28,168 internal
links.
This was referenced Oct 21, 2026

@murchandamus murchandamus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK, I think. Have to take a better look at this still.

The 196 commits are a bit distracting, it’s really just one commit on the end that should be rebased on the latest state of the repository.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RSS Issue Tracker

2 participants