-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsnippet search.html
More file actions
41 lines (34 loc) · 1.23 KB
/
snippet search.html
File metadata and controls
41 lines (34 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!-- DocSearch CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" />
<!-- Search container - place this where you want the search bar -->
<div id="algoliaBar"></div>
<!-- DocSearch JS -->
<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script>
<script type="text/javascript">
docsearch({
appId: "8IRYFS0A94",
apiKey: "f0be2c93fea1bdaf08c557853b8792ab",
indexName: "civapicom",
container: "#algoliaBar",
debug: false,
transformItems(items) {
return items.map((item) => {
const yearContent = item._highlightResult.year.value;
if (!item._highlightResult || !item._highlightResult.tree_breakdown) {
return { ...item, content: yearContent };
}
let treeBreakdown = item._highlightResult.tree_breakdown.value;
treeBreakdown = treeBreakdown.replace(/Autodesk\.Civil\./g, "").trim();
const newContent = treeBreakdown !== ""
? `${yearContent} | ${treeBreakdown}`
: yearContent;
return {
...item,
content: newContent,
};
});
},
maxResultsPerGroup: 20,
initialQuery: "2026 ",
})
</script>