Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungWe shipped guest play at 17:39 and deleted it at 18:35(21.09.2026 um 13:32 Uhr)
Sichere ProgrammierungBest MCP Servers 2026: 10 Worth Installing (Tested)(21.09.2026 um 13:42 Uhr)
Sichere ProgrammierungThe Resume Is Dying. What's Replacing It?(21.09.2026 um 13:44 Uhr)
Sichere Programmierung38 clamps, four probits, and one coefficient rounded to 15 digits(21.09.2026 um 13:46 Uhr)
Sichere ProgrammierungGmail deletes your SVG logo and Outlook ignores your flexbox(21.09.2026 um 13:47 Uhr)
Sichere Programmierung'2026-27' is a better database key than a date range(21.09.2026 um 13:49 Uhr)
Sichere ProgrammierungThe CoreDNS Black Hole: how one dead DNS pod broke our API gateway(21.09.2026 um 13:53 Uhr)
Sichere ProgrammierungWe shipped guest play at 17:39 and deleted it at 18:35(21.09.2026 um 13:32 Uhr)
Sichere ProgrammierungBest MCP Servers 2026: 10 Worth Installing (Tested)(21.09.2026 um 13:42 Uhr)
Sichere ProgrammierungThe Resume Is Dying. What's Replacing It?(21.09.2026 um 13:44 Uhr)
Sichere Programmierung38 clamps, four probits, and one coefficient rounded to 15 digits(21.09.2026 um 13:46 Uhr)
Sichere ProgrammierungGmail deletes your SVG logo and Outlook ignores your flexbox(21.09.2026 um 13:47 Uhr)
Sichere Programmierung'2026-27' is a better database key than a date range(21.09.2026 um 13:49 Uhr)
Sichere ProgrammierungThe CoreDNS Black Hole: how one dead DNS pod broke our API gateway(21.09.2026 um 13:53 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

I made a sitemap generator for mdBook. It was my first time releasing a crate!

I'm in high school in Japan. I'm afraid that this article may include some unnatural points. Motivation I'm creating a web document that explains systematically what programming is all about. I used mdBook, a static site…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

I'm in high school in Japan. I'm afraid that this article may include some unnatural points.







Motivation



I'm creating a web document that explains systematically what programming is all about. I used mdBook, a static site generator written in Rust. However, I found it doesn't support Sitemap generation.



mdBook has a rich ecosystem to expand its functionality. Luckily I found mdbook-sitemap-generator that supports my project.







GitHub logo

rxdn
/
mdbook-sitemap-generator



Utility to generate a sitemap.xml file for an mdbook project






mdbook-sitemap-generator





What is this?




mdbook-sitemap-generator is a simple utility to generate sitemap.xml files for mdbook projects.



Installation




Binaries are distributed on the Github Releases Page.


It is also possible to install this utility via cargo, using cargo install mdbook-sitemap-generator.



Usage




The utility should be run from the root of the project.


USAGE:
mdbook-sitemap-generator [OPTIONS] --domain <DOMAIN>

OPTIONS:
-d, --domain <DOMAIN>
-h, --help Print help information
-o, --output <OUTPUT>

When running the utility, you must pass the site's domain on URL via the -d flag, for example, -d docs.example.com.


If the -o flag is not passed, the sitemap will be written to stdout.


For example:


$ ls
book book.toml src
$ mdbook-sitemap-generator -d docs.example.com -o book/sitemap.xml
















However, it doesn't support the latest version of mdBook. There was an alternative sitemap-generation backend but written in Go. We can't install it through cargo. So I decided to make my own alternative.






LLM Assisted Coding



I asked Claude Sonnet to generate a simple sitemap generator written in 100% Rust. The code claude made includes implementation and unit tests. The unit tests passed. However, there is one mistake in the JSON format that mdBook sends to the custom backend.






Manual Coding



I added to it simple CI flows for validating project and integration test that simulate the latest version of mdBook behavior. Thanks to this setup, I was able to notice it doesn't run correctly.



I read mdBook documents and found JSON form mismatch. I revised the code and check if the integration test pass.




trait Tester: Sized {
fn init_book_toml() -> &'static str;

fn init_mock_contents(src_dir: &Path);

fn validate_sitemap(book_dir: &Path);

fn run_test() {
// 1. initialize virtual file system
// 2. make virtual book.toml
// 3. make src/ SUMMARRY.md and each sections
// 4. run mdBook build
// 5. validate generated sitemap.xml
}
}





I made Tester trait and make it easy to add various integration tests. If you want to see concrete implementation, see github.



https://github.com/sonneko/mdbook-sitemap/blob/main/tests/mod.rs





How to use it



No complex configuration is required! Just install through cargo and add very simple configurations on your book.toml.



cargo install mdbook-sitemap







[output.sitemap]
base-url = "https://example.com/docs"







Conclusion



Please feel free to use mdbook-sitemap. I'd appreciate it if you would give it a star.



Github:





GitHub logo

sonneko
/
mdbook-sitemap



Tool to generate a sitemap.xml file for an mdBook project






mdbook-sitemap





Crates.io
License: MIT


Tool to generate a sitemap.xml file for an mdbook project


This tool is an mdBook backend that automatically generates a sitemap.xml


file when mdbook build is run. It reads the book structure from stdin
(as JSON provided by mdbook) and writes sitemap.xml to the output directory.



Usage





  1. Install mdbook-sitemap



cargo install mdbook-sitemap




  1. Add config to your Book.toml



[output.html]

[output.sitemap]
base-url = "https://example.com/docs/"
# Optional settings:
# change-freq = "weekly" # always|hourly|daily|weekly|monthly|yearly|never
# priority = 0.7 # 0.0 - 1.0
# output-filename = "sitemap.xml" # output filename
# include-draft = false # whether to include draft chapters




Licence




MIT license

















Crates.io

https://crates.io/crates/mdbook-sitemap

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten I made a sitemap generator for mdBook. It was my first time releasing a crate!

Thematisch verwandte Begriffe: made, sitemap, generator, mdBook · 6 Treffer

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-94040 | A flaw has been found in vas3k TaxHacker up to 0.8.5. Affected by this v…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick