mdBook: Support Duplicate Entries in SUMMARY.md
So v0.4.48 just came out with #2612 and that fixed one thing and broke another.
#2612 correctly had noted that if you have a duplicate entry in SUMMARY.md that the prev/next links are broken.
However, it feels like there should still be a way to have multiple entries still. Here is how we were using it:
# Summary
[Introduction](README.md)
[Quick Start Tutorial](./GettingStarted/QuickStart.md)
---
- [Guides](./GettingStarted/README.md)
- [Quick Start](./GettingStarted/QuickStart.md)
- [Other Guide](./GettingStarted/AnotherGuide.md)
- [Fundamentals](./Fundamentals/README.md)
In the best scenario, the first link Quick Start Tutorial should just be a link to Guides/Quick Start and the prev/next buttons are for that page. Previously, the prev/next buttons were just for the first entry, which worked ok because both pages were considered active, and unlike in #2612 because it was nested and away from the other, it wasn’t as big of a deal.
Things tried:
- Symlink to a separate file. This works, but has issues for devs on non-Unix. Leads to two urls, but I’m less worried about that.
- Duplicate content. Works, but then we have to keep the two files in sync. Also leads to two urls, but I’m less worried about that.
Any other ideas on how to achieve the double pages in situations like this where it is desired?
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 2
- Comments: 15 (9 by maintainers)
Commits related to this issue
- downgrade mdbook to v0.4.47 - fixes https://github.com/rust-lang/mdBook/issues/2634 — committed to pbrucla/wiki by AVDestroyer 2 years ago
- avoid duplicates in SUMMARY.md, they're no longer allowed https://github.com/rust-lang/mdBook/issues/2634 — committed to simonmichael/hledger_site by simonmichael a year ago
I need duplicate entries in SUMMARY.md too 😦
I need duplicate entries in
SUMMARY.mdtoo.my use case
I treat
SUMMARY.mdas a chapters list, as follow:This will cause a error, since every list item in
SUMMARY.mdmust be a link.So I add dummy links:
@jacobgkau I am sorry for the changes causing you trouble.
There are a number of fixes I can think of:
The ideal solution would be probably what was suggested above with the front-matter.
@ehuss it is your call, but I would not just revert that change: I’d either improve the error message to include an explanation about the problem duplicate files cause with a link to this issue or I’d change it to a warning with a link to this issue. e.g.
It would be also nice if you commented on the solution I suggested. It could be implemented in a few hours.