Projects included: - maerchenzauber (NestJS backend + Expo mobile + SvelteKit web + Astro landing) - manacore (Expo mobile + SvelteKit web + Astro landing) - manadeck (NestJS backend + Expo mobile + SvelteKit web) - memoro (Expo mobile + SvelteKit web + Astro landing) This commit preserves the current state before monorepo restructuring. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
6.8 KiB
RSS Feeds Implementation Guide
Overview
This document describes the RSS feed implementation for the Memoro website. RSS feeds have been created for all major content collections, providing syndication capabilities in both German and English languages.
Available RSS Feeds
The following RSS feeds are available for each content collection:
| Collection | German Feed | English Feed |
|---|---|---|
| Blog | /de/blog/rss.xml |
/en/blog/rss.xml |
| Team | /de/team/rss.xml |
/en/team/rss.xml |
| Guides | /de/guides/rss.xml |
/en/guides/rss.xml |
| Features | /de/features/rss.xml |
/en/features/rss.xml |
| Industries | /de/industries/rss.xml |
/en/industries/rss.xml |
| Testimonials | /de/testimonials/rss.xml |
/en/testimonials/rss.xml |
| Blueprints | /de/blueprints/rss.xml |
/en/blueprints/rss.xml |
| Memories | /de/memories/rss.xml |
/en/memories/rss.xml |
| Wallpapers | /de/wallpapers/rss.xml |
/en/wallpapers/rss.xml |
| FAQs | /de/faqs/rss.xml |
/en/faqs/rss.xml |
| Statistics | /de/statistics/rss.xml |
/en/statistics/rss.xml |
| Changelog | /de/changelog/rss.xml |
/en/changelog/rss.xml |
Technical Implementation
Technology Stack
- RSS Generation:
@astrojs/rsspackage (v4.0.12) - Styling: XSL stylesheet for browser presentation (
/public/rss/styles.xsl) - Content Source: Astro content collections
File Structure
src/pages/
├── de/
│ ├── blog/rss.xml.js # Blog RSS (German)
│ ├── team/rss.xml.js # Team RSS (German)
│ ├── guides/rss.xml.js # Guides RSS (German)
│ └── ... # Other collections
└── en/
├── blog/rss.xml.js # Blog RSS (English)
├── team/rss.xml.js # Team RSS (English)
├── guides/rss.xml.js # Guides RSS (English)
└── ... # Other collections
Common Implementation Pattern
Each RSS feed follows a consistent pattern:
import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';
export async function GET(context) {
const items = await getCollection('collection-name');
// Filter by language and status
const filteredItems = items
.filter(item => item.data.lang === 'de') // or 'en'
.filter(item => !item.data.draft) // if applicable
.sort(/* appropriate sorting logic */);
const feedUrl = new URL('/de/collection/rss.xml', context.site).href;
return rss({
title: 'Feed Title',
description: 'Feed Description',
site: context.site,
items: filteredItems.map((item) => ({
title: item.data.title,
pubDate: item.data.dateField || new Date(),
description: item.data.description,
link: `/de/path/${item.slug}/`,
author: `${item.data.author} <till.schneider@memoro.ai>`,
// Additional fields as needed
})),
customData: `<language>de</language>
<atom:link href="${feedUrl}" rel="self" type="application/rss+xml" xmlns:atom="http://www.w3.org/2005/Atom" />`,
stylesheet: '/rss/styles.xsl',
});
}
Content-Specific Implementations
Collections with Date Fields
- Blog: Uses
pubDatefield, excludes drafts - Guides: Uses
lastUpdatedfield (required) - Statistics: Uses
publishDate, excludes drafts - Changelog: Uses
releaseDate, excludes drafts
Collections with Order Fields
- Features: Sorted by
orderfield - Industries: Sorted by
orderfield - Team: Sorted by
categoryOrderthenorder - Testimonials: Sorted by
orderfield
Collections with Status Fields
- Blueprints: Filters by
isActiveboolean - Memories: Filters by
isActiveboolean - Wallpapers: Filters by
isActive, featured items first
Special Sorting Logic
- FAQs: Featured items first, then by order
- Wallpapers: Featured items first, then by order
- Team: Category order first, then individual order
RSS Feed Features
Standard RSS Elements
- title: Item title
- pubDate: Publication date (uses appropriate date field or current date)
- description: Item description or summary
- link: Full URL to the content
- author: Author information (where available)
- categories: Tags or categories (where applicable)
Custom Elements
- language: Embedded in customData for feed language identification
- stylesheet: XSL stylesheet for browser-friendly presentation
Integration with Site
Auto-Discovery
RSS feeds should be added to the HTML head for auto-discovery by feed readers. This is typically done in the BaseHead.astro component:
<link rel="alternate" type="application/rss+xml"
title="Memoro Blog RSS"
href={`/${lang}/blog/rss.xml`} />
Feed Validation
All RSS feeds follow the RSS 2.0 specification and include:
- Required channel elements (title, link, description)
- Valid item elements with proper author email format
- Proper date formatting
- Absolute URLs for links
- Self-referencing atom:link for feed discovery
- Valid email addresses in author fields (format:
Name <email@domain.com>)
Adding New RSS Feeds
To add an RSS feed for a new content collection:
-
Create the RSS generator file:
src/pages/[lang]/[collection-name]/rss.xml.js -
Import required dependencies:
import rss from '@astrojs/rss'; import { getCollection } from 'astro:content'; -
Implement the GET function following the pattern above
-
Consider:
- Appropriate filtering (language, draft status, active status)
- Correct sorting logic
- Meaningful title and description
- Proper date field selection
- Link structure matching your routing
-
Add auto-discovery link in site head if needed
Maintenance Notes
- RSS feeds are generated at build time (static generation)
- Content updates require a rebuild to appear in feeds
- The XSL stylesheet (
/public/rss/styles.xsl) provides consistent browser presentation - All date fields default to current date if not available
- Links use absolute URLs constructed from the site URL
Testing RSS Feeds
-
Local Testing:
npm run build npm run previewVisit
http://localhost:4321/de/[feed-path]/rss.xml -
Validation:
- Use online RSS validators
- Check in multiple feed readers
- Verify all links are absolute and working
- Ensure dates are properly formatted
Best Practices
- Always filter by language to ensure language-specific feeds
- Exclude draft or inactive content as appropriate
- Use meaningful titles and descriptions in the target language
- Maintain consistent sorting logic within each collection
- Include relevant metadata (author, categories) where available
- Test feeds after any schema changes to content collections