docs(site): disable highlightSearchTermsOnTargetPage to keep URLs clean (#12661)

The @easyops-cn/docusaurus-search-local option appends ?_highlight=<term>
query params to links from the search bar. Docusaurus puts the query string
before the #anchor, producing URLs like

    /docs/foo?_highlight=bar#section

which look broken when copy-pasted. Turn the option off — Ctrl+F on the
landing page covers the same use case without polluting shareable links.
This commit is contained in:
Teknium 2026-04-19 11:56:34 -07:00 committed by GitHub
parent ef73367fc5
commit cad3f8a37f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -37,7 +37,9 @@ const config: Config = {
language: ['en'], language: ['en'],
indexBlog: false, indexBlog: false,
docsRouteBasePath: '/', docsRouteBasePath: '/',
highlightSearchTermsOnTargetPage: true, // Disabled: appends ?_highlight=... to URLs (before the #anchor),
// which makes copy/pasted doc links ugly. Ctrl+F on the page is fine.
highlightSearchTermsOnTargetPage: false,
}), }),
], ],
], ],