mdBook icon indicating copy to clipboard operation
mdBook copied to clipboard

Sitemap.xml Generate

Open cuongthachHQ opened this issue 4 years ago • 9 comments
trafficstars

mdBook have no sitemap.xml generator. I think of it will hurt SEO.

cuongthachHQ avatar Mar 20 '21 14:03 cuongthachHQ

Agree.

They may be other issue as well, Google seem to not index pages of a book, even if the first page was submitted and indexed. Even after months. Other experience this?

gagarine avatar Mar 20 '21 20:03 gagarine

Any update on this?

avivace avatar Jul 30 '21 13:07 avivace

I wonder if this is something that could be generated with a preprocessor or backend plugin: https://rust-lang.github.io/mdBook/for_developers/index.html

joshrotenberg avatar Jul 30 '21 14:07 joshrotenberg

With a back-end, this would require calling the HTML renderer from that back-end which doesn't sound all that great imo. I am preparing a PR to add support for this in the built-in HTML renderer, I think we can judge then if it's worth integrating.

ISSOtm avatar Jul 30 '21 15:07 ISSOtm

Finished the PR in question!

ISSOtm avatar Jul 30 '21 16:07 ISSOtm

Also looking for this, thank you.

joshxyzhimself avatar Sep 28 '21 20:09 joshxyzhimself

If folks are looking for a workaround in the meantime, I ended up using an existing static site sitemap generator called static-sitemap-cli. See the CI job at https://github.com/sunshowers-code/rust-cli-recommendations/blob/main/.github/workflows/docs.yml for how to use it, and the generated sitemap itself here.

sunshowers avatar Feb 13 '22 02:02 sunshowers

I had this same problem. Only the landing page in my mdBook site was indexed. I had to manually submit all other pages (about 8) for indexing.

pcgeek86 avatar Oct 27 '23 06:10 pcgeek86

There's this project: https://github.com/rxdn/mdbook-sitemap-generator

EDIT: but it doesn't seem maintained, a broken install has plagued this for half a year already.

joepio avatar Jan 15 '25 13:01 joepio

Facing the same problem I've decided to fork/reimplement https://github.com/rxdn/mdbook-sitemap-generator here: https://github.com/loicsikidi/mdbook-sitemap-generator.

The project is working (e.g., https://tpmpills.com/sitemap.xml) and I'm planning to make the tool compliant w/ mdbook backend to ease the setup.

loicsikidi avatar May 30 '25 07:05 loicsikidi

Today, I had time implement the backend feature, it's available starting >= v1.2.0.

📝 check the readme for more info.

loicsikidi avatar May 30 '25 17:05 loicsikidi