-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca3d244
commit 59544d4
Showing
2 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
recordExtractor: ({ $, helpers, url }) => { | ||
// Remove in-page navigation components before extracting records. | ||
$(".cards-nav").remove(); | ||
|
||
const isTutorialPage = /\/[\w-]+\/tutorial\//.test(url.pathname); | ||
const isErrorReference = /\/[\w-]+\/reference\/errors\//.test( | ||
url.pathname, | ||
); | ||
|
||
return helpers.docsearch({ | ||
recordProps: { | ||
lvl1: "main h1", | ||
content: "main p, main li", | ||
lvl0: { | ||
// Use hidden tag on docs site to extract page categories. | ||
selectors: "#docsearch-lvl0", | ||
defaultValue: "Learn", | ||
}, | ||
lvl2: "main h2", | ||
lvl3: "main h3", | ||
lvl4: "main h4", | ||
lvl5: "main h5", | ||
}, | ||
indexHeadings: true, | ||
}); | ||
} |