Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Multiple mdbook with navbar #1748

Open
laoshaw opened this issue Feb 14, 2022 · 2 comments
Open

Feature Request: Multiple mdbook with navbar #1748

laoshaw opened this issue Feb 14, 2022 · 2 comments

Comments

@laoshaw
Copy link

laoshaw commented Feb 14, 2022

I have multiple mdbooks now that are all independent, is there a way for mdbook to support a navigation (on the top or somewhere) that I can have(or host) multiple books co-exist in one site?

something like the attached screenshot:

image

@laoshaw
Copy link
Author

laoshaw commented Feb 23, 2022

vitepress is doing just that: https://github.com/vuejs/docs/blob/main/.vitepress/config.ts

@kg4zow
Copy link

kg4zow commented Jun 8, 2022

You can edit theme/index.hbs and add whatever you like within the <body> tag. Adding new content before the <nav> tag will result in something being added to the top of the generated HTML pages.

Of course this means when you upgrade mdbook, you may have to upgrade your book's custom theme/index.hbs file as well. The original file is formatted very nicely, so it should be fairly simple to flag your changes within the file, so you can make the same changes when the new version's index.hbs file comes out. As an example, see this file lines 108-119.

Also, be careful about whether your new content should be included or not when the book is printed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants