From 59544d480186fd5aef8cfa69a1ad524150f0988f Mon Sep 17 00:00:00 2001 From: James Gray Date: Fri, 14 Jun 2024 15:41:25 -0600 Subject: [PATCH] changes --- astro.config.mjs | 6 +++--- testing.js | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 testing.js diff --git a/astro.config.mjs b/astro.config.mjs index 4e26561..4e245de 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -29,9 +29,9 @@ export default defineConfig({ ], plugins: [ starlightDocSearch({ - appId: '82VLS1TU5K', - apiKey: 'bfdc9eff848b16b6167efaa4a84d5e27', - indexName: 'fontawesome', + appId: 'FHAKRV7GHA', + apiKey: '26a8eedb0937f39c55c689e3ea6f6d68', + indexName: 'randombeeperio', }), ], }), diff --git a/testing.js b/testing.js new file mode 100644 index 0000000..5efb11b --- /dev/null +++ b/testing.js @@ -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, + }); + } \ No newline at end of file