A preprocessor for mdBook that generates an RSS feed from your chapters.
The code is built on the example from the documentation.
First, make sure to install this to your $PATH
so mdbook
can find and use it:
cargo install --git <url to this repository>
This section describes "global" configuration for the feed itself.
mdbook-rss
looks for a [preprocessor.rss]
section in your book.toml:
toml
[preprocessor.rss]
files-glob = "posts/*.md"
url-base = "https://example.com/"
Available configuration keys taken from the book.toml:
- files-glob
: A file glob used to specify which files to include in the RSS feed
- url-base
: A URL that, in combination with the files' path is used to build links to the articles.
Basically this is a combination of the domain where the mdbook is hosted and the book's site-url
option.
Note that due to implementation detail of url::Url::join
this should end with a '/'.
The resulting RSS feed is written to an rss.xml
file next to your SUMMARY.md
, so it can be accessed via <url-base>/rss.xml
.
This section describes configuration on a per-chapter base.
In addition to global configuration, you may configure some attributes of each of your book's chapters, by defining a front matter like this:
pub_date: Wed, 03 Mar 2021 12:00:00 GMT
Rest of your markdown ```
Currently only pub_date
and description
are supported with the description being optional.
NOTE: This front matter ist removed from each chapter, so it won't be available anymore for preprocessors running after this one!
authors
field for each RSS item. The code in this repository is released under the Mozilla Public License Version 2.0.