I am getting started with DocSearch and while it works, I get double results:
- App ID:
BH4D9OD16A
- Setup (to make it easier for others to apply to their problem)
- Static Github site user.github.io (edit: it’s a made up link, no need to click, sorry for the confusion)
- DocSarch content is at user.github.io/docs/
- DocSearch configuration:
"selectors": {
"lvl0": {
"selector": "",
"global": true,
"default_value": "Documentation"
},
"lvl1": "main h1",
"lvl2": "main h2",
"lvl3": "main h3",
"lvl4": "main h4",
"lvl5": "main h5",
"text": "main p, main li"
}
This is how it looks like:
It appears (I’m not good at JS/CSS, obviously, otherwise I wouldn’t be asking :-D) the reason might be that my static docs pages (Bootstrap) have section ToCs
a) content I want to find is always “main” content (main class="..."
), but
b) sometimes main content also has a page ToC (div class="toctree-wrapper compound"
) with ToC items that seem to correspond to main li
c) in worst cases there’s 3 results (e.g. page.html, its page ToC (in main
), and the first in-page ToC entry itself as page.html#sec1)
I guess I should try to exclude main li
(at least that) from my DocSearch config ("text": "main p, main li"
).
Any other ideas from Bootstrap or related experiences?