Skip to content

Commit

Permalink
docs: update feed section
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa committed Dec 30, 2023
1 parent 4b0b8ad commit 21fa33f
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docs/src/users/feed.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,43 @@ These feeds should be auto-discoverable on the homepage:

Hatsu detects all available feeds and prioritizes them in order of `JSON > Atom > RSS`.

## JSON Feed

Hatsu uses `serde` to parse JSON Feed directly, so you can expect it to have first-class support.

Please make sure your feed is valid in [JSON Feed Validator](https://validator.jsonfeed.org/) first.

### JSON Feed Items

Hatsu infers object id from `item.url` and `item.id`.

It will use the `item.url` first, and if it doesn't exist, it will try to convert the `item.id` to an absolute url.

```text
https://example.com/foo/bar => https://example.com/foo/bar
/foo/bar => https://example.com/foo/bar
foo/bar => https://example.com/foo/bar
```

Ideally, your `item.id` and `item.url` should be consistent absolute links:

```json
{
"id": "https://example.com/foo/bar",
"url": "https://example.com/foo/bar",
"title": "...",
"content_html": "...",
"date_published": "..."
}
```

### JSON Feed Extension

If you can customize your site's JSON Feed,
you might also want to check out the [Hatsu JSON Feed Extension](../others/json-feed-extension.md).

## Atom / RSS

Hatsu uses `feed-rs` to parse XML feeds and convert them manually.

This section is currently lacking testing, so feel free to report bugs.

0 comments on commit 21fa33f

Please sign in to comment.