-
Notifications
You must be signed in to change notification settings - Fork 866
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
weight
attribute to promote Guide in algolia search (#1541)
* new custom attribute for algolia search * Use test index temporarily * Back to `prod` index --------- Co-authored-by: Charlotte Wickham <[email protected]> (cherry picked from commit 9dd0c5f)
- Loading branch information
1 parent
fc4db01
commit 68b6089
Showing
2 changed files
with
9 additions
and
0 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,7 @@ | ||
const j = JSON.parse(Deno.readTextFileSync("_site/search.json")); | ||
j.forEach((entry) => { | ||
const crumb = entry.crumbs || []; | ||
entry.weight = crumb[0] === "Guide" ? 1 : 0; | ||
}) | ||
Deno.writeTextFileSync("_site/search.json", JSON.stringify(j, null, 2)); | ||
|