What Changes selectors of API references to improve DocSearch results Implements custom navigation for DocSearch in both API ref and docs. (Uses goTo method for in page navigation, Gatsby navigate for navigation within Gatsby site, changes URL's to API reference to make use of methods implemented to provide better metadata etc.) Implements a new way to make all HTML available in API reference without need the crawler to have Javascript enabled which should allow Algolia to crawl our site faster. Why To provide users with a good search experience within our docs and API reference Testing Tested using a local setup of the Algolia crawler
14 lines
318 B
JavaScript
14 lines
318 B
JavaScript
export const checkDisplay = element => {
|
|
const mc = element.closest("#method-container")
|
|
|
|
//if no closest method container exists then it is a section and we can scroll
|
|
if (!mc) return true
|
|
|
|
const style = getComputedStyle(mc)
|
|
if (style.display === "none") {
|
|
return false
|
|
} else {
|
|
return true
|
|
}
|
|
}
|