From eb7d4d68e65d88b030894c74da945f2fdcbe4461 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Wed, 15 Jan 2025 15:40:05 -0500 Subject: [PATCH 1/3] new custom attribute for algolia search --- _quarto.yml | 2 ++ tools/algolia-add-custom-attribute.ts | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 tools/algolia-add-custom-attribute.ts diff --git a/_quarto.yml b/_quarto.yml index e247c6d343..1c9ea0a17b 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -1,6 +1,8 @@ project: type: website output-dir: _site + post-render: + - tools/algolia-add-custom-attribute.ts resources: - "/docs/download/_download.json" - "/docs/download/_prerelease.json" diff --git a/tools/algolia-add-custom-attribute.ts b/tools/algolia-add-custom-attribute.ts new file mode 100644 index 0000000000..d516338bb9 --- /dev/null +++ b/tools/algolia-add-custom-attribute.ts @@ -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)); + \ No newline at end of file From 394af3174acfce15a144279d30d10b0bb4cd1f09 Mon Sep 17 00:00:00 2001 From: Charlotte Wickham Date: Thu, 16 Jan 2025 09:17:16 -0800 Subject: [PATCH 2/3] Use test index temporarily --- _quarto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_quarto.yml b/_quarto.yml index 1c9ea0a17b..f538a322d0 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -31,7 +31,7 @@ website: show-item-context: true type: overlay algolia: - index-name: prod_QUARTO + index-name: test_QUARTO application-id: ZPJB5I1QN7 search-only-api-key: 41be6c1e0a7fea4a51b107810facf577 analytics-events: true From 2f4cfec5aec5b12d0961d484b17ada38270aa42e Mon Sep 17 00:00:00 2001 From: Charlotte Wickham Date: Fri, 17 Jan 2025 09:18:56 -0800 Subject: [PATCH 3/3] Back to `prod` index --- _quarto.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_quarto.yml b/_quarto.yml index f538a322d0..1c9ea0a17b 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -31,7 +31,7 @@ website: show-item-context: true type: overlay algolia: - index-name: test_QUARTO + index-name: prod_QUARTO application-id: ZPJB5I1QN7 search-only-api-key: 41be6c1e0a7fea4a51b107810facf577 analytics-events: true