AI Web FeedsAI Web FeedsOpen web AI reader
  • Features
    Documentation

    RSS Feeds

    Subscribe to documentation updates via RSS, Atom, or JSON feeds

    Source: apps/web/content/docs/features/rss-feeds.mdx

    Subscribe to AI Web Feeds documentation updates using RSS, Atom, or JSON feeds.

    Available Feeds

    Sitewide Feed All content from the entire site

    Documentation Feed Only documentation pages

    Multiple Formats RSS 2.0, Atom 1.0, and JSON Feed

    Auto-Updated Refreshed hourly with latest content

    Feed URLs

    Sitewide Feeds

    Subscribe to all content:

    https://yourdomain.com/rss.xml Standard RSS 2.0 format, compatible with most feed readers.
    https://yourdomain.com/atom.xml Atom 1.0 format with extended metadata support.
    https://yourdomain.com/feed.json Modern JSON-based feed format.

    Documentation Feeds

    Subscribe to documentation updates only:

    https://yourdomain.com/docs/rss.xml
    https://yourdomain.com/docs/atom.xml
    https://yourdomain.com/docs/feed.json

    Feeds are automatically discoverable via <link> tags in the HTML head for compatible feed readers.

    Feed Readers

    Choose your preferred feed reader:

    Command Line

    Use curl to fetch feeds:

    # RSS 2.0
    curl https://yourdomain.com/rss.xml
    
    # Atom 1.0
    curl https://yourdomain.com/atom.xml
    
    # JSON Feed
    curl https://yourdomain.com/feed.json | jq

    Feed Content

    What's Included

    Each feed item contains:

    FieldDescription
    TitlePage title
    DescriptionPage description or excerpt
    LinkFull URL to the page
    DateLast modified date
    CategoryContent category (Features, Guides, etc.)
    AuthorAI Web Feeds Team

    Categories

    Content is categorized automatically:

    • Features - Feature documentation
    • Guides - How-to guides and tutorials
    • Documentation - General documentation pages

    How It Works

    Feed Generation

    Feeds are generated using the feed package:

    lib/rss.ts
    import { Feed } from "feed";
    import { source } from "@/lib/source";
    
    export function getDocsRSS() {
      const feed = new Feed({
        title: "AI Web Feeds - Documentation",
        id: `${baseUrl}/docs`,
        link: `${baseUrl}/docs`,
        language: "en",
        description: "Documentation updates...",
      });
    
      for (const page of source.getPages()) {
        feed.addItem({
          id: `${baseUrl}${page.url}`,
          title: page.data.title,
          description: page.data.description,
          link: `${baseUrl}${page.url}`,
          date: new Date(page.data.lastModified),
        });
      }
    
      return feed;
    }

    Route Handlers

    Next.js route handlers serve the feeds:

    app/docs/rss.xml/route.ts
    import { getDocsRSS } from "@/lib/rss";
    
    export const revalidate = 3600; // Revalidate every hour
    
    export function GET() {
      const feed = getDocsRSS();
    
      return new Response(feed.rss2(), {
        headers: {
          "Content-Type": "application/rss+xml; charset=utf-8",
          "Cache-Control": "public, max-age=3600, s-maxage=86400",
        },
      });
    }

    Metadata Discovery

    Feeds are discoverable via metadata:

    app/layout.tsx
    export const metadata: Metadata = {
      alternates: {
        types: {
          "application/rss+xml": [
            {
              title: "AI Web Feeds - Documentation",
              url: "/docs/rss.xml",
            },
          ],
        },
      },
    };

    Caching Strategy

    Feeds are cached for performance:

    Cache LayerDurationPurpose
    Browser1 hourClient-side caching
    CDN24 hoursEdge caching
    Revalidation1 hourServer regeneration
    Feeds are revalidated every hour to ensure fresh content while maintaining performance.

    Testing

    Test Feed URLs

    # Test RSS feed
    curl http://localhost:3000/rss.xml | head -50
    
    # Test Atom feed
    curl http://localhost:3000/atom.xml | head -50
    
    # Test JSON feed
    curl http://localhost:3000/feed.json | jq
    
    # Check headers
    curl -I http://localhost:3000/rss.xml

    Use the W3C Feed Validator:

    1. Visit https://validator.w3.org/feed/
    2. Enter your feed URL
    3. Click "Check"
    4. Review validation results

    Verify Feed Discovery

    Check that feeds are discoverable:

    # View HTML head
    curl http://localhost:3000 | grep -i "alternate"
    
    # Expected output:
    # <link rel="alternate" type="application/rss+xml" ... />

    Test Feed Reader

    1. Open your feed reader
    2. Click "Add Feed" or "Subscribe"
    3. Enter feed URL: http://localhost:3000/rss.xml
    4. Verify items appear correctly

    Customization

    Update Base URL

    Set your production URL:

    .env.local
    NEXT_PUBLIC_BASE_URL=https://yourdomain.com

    Modify Feed Metadata

    Edit lib/rss.ts:

    const feed = new Feed({
      title: "Your Custom Title",
      description: "Your custom description",
      copyright: "All rights reserved 2025, Your Name",
      // Add more fields...
    });

    Add Custom Fields

    Extend feed items with custom data:

    feed.addItem({
      id: `${baseUrl}${page.url}`,
      title: page.data.title,
      description: page.data.description,
      link: `${baseUrl}${page.url}`,
      date: new Date(page.data.lastModified),
    
      // Custom fields
      image: page.data.image,
      content: await getPageContent(page),
      // More custom fields...
    });

    Filter Content

    Control which pages appear in feeds:

    const pages = source
      .getPages()
      .filter((page) => !page.data.draft) // Exclude drafts
      .filter((page) => page.url.startsWith("/docs")); // Only docs

    Best Practices

    1. Set Last Modified Dates

    Add lastModified to frontmatter:

    ---
    title: My Page
    description: Description
    lastModified: 2025-10-14
    ---

    2. Write Good Descriptions

    Provide clear, concise descriptions:

    ---
    title: RSS Feeds
    description: Subscribe to documentation updates via RSS, Atom, or JSON feeds
    ---

    3. Use Proper Categories

    Organize content with meaningful categories:

    category: page.url.includes("/api/") ? [{ name: "API Reference" }] : [{ name: "Guides" }];

    4. Cache Appropriately

    Balance freshness with performance:

    export const revalidate = 3600; // 1 hour

    Troubleshooting

    Feed Not Updating

    Clear the Next.js cache: bash rm -rf .next/ pnpm dev

    Invalid XML

    • Ensure special characters are escaped
    • Validate with W3C Feed Validator
    • Check for proper UTF-8 encoding

    Missing Items

    • Verify source.getPages() returns all pages
    • Check filter conditions
    • Ensure frontmatter is complete

    Slow Generation

    • Reduce number of items
    • Implement pagination
    • Increase revalidation time

    Future Enhancements

    Potential additions:

    • Blog feed - Separate feed for blog posts
    • Category feeds - Individual feeds per category
    • Per-author feeds - Filter by author
    • Full content - Include complete page content
    • Media enclosures - Attach images/files
    • Podcasting support - iTunes RSS extensions

    External Resources

    RSS Feeds | AI Web Feeds