Repository navigation
feat(blog): RSS feed per locale - #16
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an RSS 2.0 feed for the blog in every locale, as requested in #2.
src/ ├── layouts/Base.astro # + <link rel="alternate" type="application/rss+xml"> └── pages/[lang]/blog/ ├── index.astro + └── rss.xml.ts # /<lang>/blog/rss.xmlEach feed lists the same posts as that locale's blog index. Untranslated posts appear in English, as they do on the index. The feed is generated at build time without a new dependency (
@astrojs/rsswould add a package for about 30 lines of XML).Closes #2
Evidence
/en/blog/rss.xml,/es/blog/rss.xml, …), each with 21 items, and all of them parse as valid XML.<head>links the feed for its locale, e.g.<link rel="alternate" type="application/rss+xml" title="Perry Blog" href="/ja/blog/rss.xml">, so feed readers find it from any page URL.server.tsalready serves.xmlfiles asapplication/xml.Merge Danger
Door: two-way
Blast Radius: small
Only new files plus one
<link>tag in the shared layout.