-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
Context
I have multiple mkdocs-backed doc sections that compose the Dokku project:
- main docs
- tutorials subsite
- etc.
All of these have their own release cycle and thus are in different repositories, but more or less roll up to the same "dokku/docs" repo for their generated contents. This allows me to have quicker CI runs for each while still keeping on the same domain.
One thing that isn't great is that search results are scoped to just the section a user happens to be on. It is all effectively one "site" but because of how the sites are generated, we don't show the related documentation from each sub-site.
Description
What I would like to do is be able to configure mkdocs such that it can either:
- Point to several search indexes
- I can manually merge the indexes and specify a custom "site_dir" for each search result
If several indexes are merged, a user should be able to specify some config:
- an index title
- an optional favicon to show next to the index title
This would then appear in search results in a more unified way, with tabs for each index.
Related links
I looked to see if this was in the discussion board and docs, and that doesn't seem to be the case.
Use Cases
Maybe a user could configure other search indexes to load like so:
plugins
- search:
additional_indexes:
- title: Documentation
site_index: https://example.com/docs/
index_url: https://example.com/docs/search/search_index.json
- title: Tutorials
site_index: https://example.com/tutorials/
index_url: https://example.com/tutorials/search/search_index.jsonWhen building search results, the results from these additional indexes would have their site_index injected and then that would be used when templating out results to provide a link to the docs. Search would maybe have to be refactored a bit to run against several indexes at once (not sure how that would work, was a bit hard to grok how search is launched from a quick browse of the source).
From a developer's perspective, the yaml config is all they would need to completely spider a site (or multiple sites) and have their results show up. For users, this unified search would provide a much better experience when browsing multiple distinct doc results.
Visuals
Below is something I'm hoping to approximate, from the Nomad documentation.
Before submitting
- I have read and followed the change request guidelines.
- I have verified that my idea is a change request and not a bug report.
- I have ensured that, to the best knowledge, my idea will benefit the entire community.
- I have included relevant links to the documentation, related issues and discussions to underline the need for my idea.
