Skip to content

Commit

Permalink
docs: add rss guide
Browse files Browse the repository at this point in the history
Co-authored-by: HiDeoo <[email protected]>
  • Loading branch information
sarah11918 and HiDeoo authored May 11, 2024
1 parent 33366c1 commit c80283d
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export default defineConfig({
items: [
{ label: 'Frontmatter', link: '/guides/frontmatter/' },
{ label: 'Authors', link: '/guides/authors/' },
{ label: 'RSS', link: '/guides/rss/' },
],
},
],
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ A [Starlight](https://starlight.astro.build) plugin to add a blog to your docume
- Global and per-post authors
- Tags
- Custom sidebar with recent posts and tags
- RSS (requires the Astro [`site`](https://docs.astro.build/en/reference/configuration-reference/#site) option to be set)
- RSS

Check out the [demo](/blog/) for a preview of the blog.

Expand Down
34 changes: 34 additions & 0 deletions docs/src/content/docs/guides/rss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: RSS
description: Learn how to configure the RSS feed for your blog.
---

Starlight Blog automatically generates an RSS feed for your blog when the Astro [`site`](https://docs.astro.build/en/reference/configuration-reference/#site) option is set.
When defined, the following changes are made:

- An RSS feed is generated at `/blog/rss.xml` (can be customized with the [`prefix`](/configuration/#prefix) option)
- A sidebar link to the RSS feed is added to the blog
- A [social link](https://starlight.astro.build/reference/configuration/#social) to the RSS feed is added to the Starlight header
- [RSS feed auto-discovery](https://docs.astro.build/en/guides/rss/#enabling-rss-feed-auto-discovery) is automatically configured

## Configure your RSS feed

Set the Astro [`site`](https://docs.astro.build/en/reference/configuration-reference/#site) configuration option in the `astro.config.mjs` file.

```diff lang=js title="astro.config.mjs"
import starlight from '@astrojs/starlight'
import { defineConfig } from 'astro/config'
import starlightBlog from 'starlight-blog'

export default defineConfig({
+ site: 'https://www.example.com'
starlight({
social: {
plugins: [starlightBlog()],
title: 'My Docs',
},
}),
})
```

This will create a `.xml` file for feed readers, add a sidebar link to the RSS feed, add the standard RSS icon to your website's header and configure RSS feed auto-discovery.
2 changes: 1 addition & 1 deletion packages/starlight-blog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ A [Starlight](https://starlight.astro.build) plugin to add a blog to your docume
- Global and per-post authors
- Tags
- Custom sidebar with recent posts and tags
- RSS (requires the Astro [`site`](https://docs.astro.build/en/reference/configuration-reference/#site) option to be set)
- RSS

Check out the [demo](https://starlight-blog-docs.vercel.app//blog/) for a preview of the blog.

Expand Down

0 comments on commit c80283d

Please sign in to comment.