Skip to content

Commit 6f67d72

Browse files
committed
Revert "Fix "Update Search Index" - take 2 (#14067)"
This reverts commit 1e0dfb4.
1 parent 0a8038d commit 6f67d72

File tree

3 files changed

+195
-196
lines changed

3 files changed

+195
-196
lines changed

scripts/search/page.ts

+21-21
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import * as rank from "./rank";
4545
const $ = cheerio.load(content, {
4646
_useHtmlParser2: true,
4747
decodeEntities: true
48-
} as any /* We are using a hidden option: _useHtmlParser2: https://github.com/cheeriojs/cheerio/discussions/1271 */);
48+
});
4949

5050
const subheads = [];
5151

@@ -161,23 +161,23 @@ import * as rank from "./rank";
161161
return secondaries;
162162
}
163163

164-
// Clean up (i.e., de-dupe, simplify, etc.) the items in a breadcrumb list.
165-
export function makeAncestorsList(rawList: string[]) {
166-
return Array.from(new Set(rawList).values())
167-
.filter(s => s?.trim() !== "")
168-
.map(s => {
169-
if (s === "Pulumi Registry") {
170-
return "Registry";
171-
}
172-
return s;
173-
});
174-
}
175-
176-
// Every Algolia record requires a unique ID. Since every record should also have a unique URL,
177-
// we use the URL to generate the unique ID.
178-
//
179-
// If, at some point, we find that we need to have two records pointing to the same URL, we can
180-
// add another parameter to the list and hash both.
181-
export function getObjectID({ href }) {
182-
return crypto.createHash("md5").update(href).digest("hex");
183-
}
164+
// Clean up (i.e., de-dupe, simplify, etc.) the items in a breadcrumb list.
165+
export function makeAncestorsList(rawList) {
166+
return [ ...new Set(rawList) ]
167+
.filter(s => s?.trim() !== "")
168+
.map(s => {
169+
if (s === "Pulumi Registry") {
170+
return "Registry";
171+
}
172+
return s;
173+
});
174+
}
175+
176+
// Every Algolia record requires a unique ID. Since every record should also have a unique URL,
177+
// we use the URL to generate the unique ID.
178+
//
179+
// If, at some point, we find that we need to have two records pointing to the same URL, we can
180+
// add another parameter to the list and hash both.
181+
export function getObjectID({ href }) {
182+
return crypto.createHash("md5").update(href).digest("hex");
183+
}

0 commit comments

Comments
 (0)