# Fumadocs (Framework Mode, Next.js): RSS 摘要
URL: /zh-TW/docs/next/guides/rss
Source: https://raw.githubusercontent.com/fuma-nama/fumadocs/refs/heads/main/apps/docs/content/docs/(framework)/[framework]/guides/rss.zh-TW.mdx

為您的文件或部落格產生 RSS 摘要。

## 設定 [#setup]

您可以建立 feed 物件：

```ts title="lib/rss.ts"
import { Feed } from 'feed';
import { source } from '@/lib/source';

const baseUrl = 'https://fumadocs.dev';

export function getRSS() {
  const feed = new Feed({
    title: 'Fumadocs Blog',
    id: `${baseUrl}/blog`,
    link: `${baseUrl}/blog`,
    language: 'en',

    image: `${baseUrl}/banner.png`,
    favicon: `${baseUrl}/icon.png`,
    copyright: 'All rights reserved 2025, Fuma Nama',
  });

  for (const page of source.getPages()) {
    feed.addItem({
      id: page.url,
      title: page.data.title,
      description: page.data.description,
      link: `${baseUrl}${page.url}`,
      date: page.data.lastModified ?? new Date(),

      author: [
        {
          name: 'Fuma',
        },
      ],
    });
  }

  return feed.rss2();
}
```

接著透過路由提供 RSS：

```ts title="app/rss.xml/route.ts"
import { getRSS } from '@/lib/rss';

export const revalidate = false;

export function GET() {
  return new Response(getRSS());
}
```

### 連結 Feed [#link-the-feed]

請在您的頁面中加入 Feed 的連結，讓 Feed 閱讀器能夠找到它：

```ts title="app/layout.tsx"
import type { Metadata } from 'next';

export const metadata: Metadata = {
  alternates: {
    types: {
      'application/rss+xml': [
        {
          title: 'Fumadocs Blog',
          url: 'https://fumadocs.dev/rss.xml',
        },
      ],
    },
  },
};
```