Skip to content

Commit

Permalink
suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Mar 8, 2023
1 parent 2651581 commit c53bfee
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
5 changes: 2 additions & 3 deletions .changeset/popular-rules-divide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
'@astrojs/rss': minor
---

Added `trailingSlash` option, to control whether the emitted URLs should have the trailing slash.

Added `trailingSlash` option to control whether or not the emitted URLs should have trailing slashes.

```js
import rss from '@astrojs/rss';
Expand All @@ -13,4 +12,4 @@ export const get = () => rss({
});
```

By passing `false`, the emitted links won't have the trailing slash.
By passing `false`, the emitted links won't have trailing slashes.
30 changes: 15 additions & 15 deletions packages/astro-rss/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,21 @@ The `content` key contains the full content of the post as HTML. This allows you
[See our RSS documentation](https://docs.astro.build/en/guides/rss/#including-full-post-content) for examples using content collections and glob imports.
### `trailingSlash`
Type: `boolean (optional)`
Default: `true`
By default, the library will add trailing slashes to the emitted URLs. To prevent this behavior, add `trailingSlash: false` to the `rss` function.
```js
import rss from '@astrojs/rss';
export const get = () => rss({
trailingSlash: false
});
```
## `rssSchema`
When using content collections, you can configure your collection schema to enforce expected [`RSSFeedItem`](#items) properties. Import and apply `rssSchema` to ensure that each collection entry produces a valid RSS feed item:
Expand Down Expand Up @@ -235,21 +250,6 @@ export async function get(context) {
}
```

### `trailingSlash`

Type: `boolean (optional)`
Default: "always"

By default, the library will add trailing slashes to the emitted URLs. To prevent this behavior, add `trailingSlash: false` to the `rss` function.

```js
import rss from '@astrojs/rss';

export const get = () => rss({
trailingSlash: false
});
```

---

For more on building with Astro, [visit the Astro docs][astro-rss].
Expand Down

0 comments on commit c53bfee

Please sign in to comment.