mdbook-rss-feed
An mdBook preprocessor that generates a beautiful RSS 2.0 feed (and optional Atom) for your book, with HTML previews for each chapter.
Perfect for blogs, documentation sites, or any mdBook that you want to publish.
Sorry for the frequent updates, this should be close to stable now.
Features
-
HTML preview in
<description>built from the first paragraphs of each chapter -
Hybrid preview source:
- Prefer chapter body content for the preview
- Fall back to
descriptionin frontmatter when the body is empty or very short
-
Proper XML escaping via the
rsscrate -
Falls back to file modification time if no date in frontmatter
-
Supports
date:in YAML frontmatter (RFC3339 orYYYY-MM-DD) -
Respects
config.book.title,config.book.description, andoutput.html.site-url -
Zero-config, just drop it in
book.toml
Installation
Version Check:
Tested against:
- mdBook v0.4.40 & v0.5.1
- Rust editions 2020 & 2024
Usage
After installing globally, add the following to your mdbook's book.toml:
[]
= ["html"]
The renderers = ["html"] configuration in book.toml explicitly binds the
preprocessor to run only when mdBook uses the HTML renderer, preventing it from
executing unnecessarily for other output formats like Markdown or PDF.
Frontmatter
title: Debugging NixOS modules
date:
author: saylesss88
description: This chapter covers debugging NixOS modules, focusing on tracing module
options and evaluating merges.
How description is used
-
Default behavior: The RSS preview is generated from the first few paragraphs of the chapter body.
-
Fallback behavior: If the chapter body is empty or extremely short, the preview is generated from the
descriptionfield instead. -
This makes
descriptiona good place for a short, human‑written summary, while still keeping the preview in sync with the chapter content in normal cases.
If you prefer not to rely on this fallback at all, you can simply omit
description in your frontmatter; the preview will always come from the chapter
body.
Hiding frontmatter in the rendered HTML
mdBook does not natively parse or remove YAML frontmatter from Markdown files,
treating it as plain text during rendering, which can result in the raw YAML
block (e.g., ---\ntitle: "My Chapter"\n---) appearing directly in the
generated HTML output.
To avoid this, you can use:
License
Apache-2.0