Skip to content

Commit

Permalink
Update templates.mdx
Browse files Browse the repository at this point in the history
edited the starlight template from feedback
  • Loading branch information
randombeeper authored Jul 22, 2024
1 parent 580e14f commit 660f53c
Showing 1 changed file with 7 additions and 25 deletions.
32 changes: 7 additions & 25 deletions packages/website/docs/templates.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ new Crawler({
rateLimit: 8,
maxDepth: 10,
startUrls: ['https://YOUR_WEBSITE_URL/'],
sitemaps: ['https://YOUR_WEBSITE_URL/sitemap.xml'],
sitemaps: ['https://YOUR_WEBSITE_URL/sitemap-index.xml'],
ignoreCanonicalTo: true,
discoveryPatterns: ['https://YOUR_WEBSITE_URL/**'],
actions: [
Expand All @@ -413,36 +413,18 @@ new Crawler({
.find("span")
.text() || "Documentation";

// Get the second level menu item
var lvl1 = 'a[aria-current="page"] span';
var lvl2 = "main h1";
var lvl3 = "main h2";
var lvl4 = "main h3";
var lvl5 = "main h4";
var lvl6 = "main h5";

// If not able to get the menu item then make this generic
if (lvl0 === "Documentation") {
lvl1 = "main h1";
lvl2 = "main h2";
lvl3 = "main h3";
lvl4 = "main h4";
lvl5 = "main h5";
lvl6 = "main h6";
}

return helpers.docsearch({
recordProps: {
lvl0: {
selectors: "",
defaultValue: lvl0,
},
lvl1: lvl1,
lvl2: lvl2,
lvl3: lvl3,
lvl4: lvl4,
lvl5: lvl5,
lvl6: lvl6,
lvl1: "main h1",
lvl2: "main h2",
lvl3: "main h3",
lvl4: "main h4",
lvl5: "main h5",
lvl6: "main h6",
content: "main p, main li",
},
indexHeadings: true,
Expand Down

0 comments on commit 660f53c

Please sign in to comment.