Skip to content

Commit 3a789a6

Browse files
authored
Merge pull request #1616 from quarto-dev/sync-1612-to-prerelease
[Sync to prerelease] run post-render script only on project render
2 parents 465c114 + fb35dca commit 3a789a6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/algolia-add-custom-attribute.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// don't run the post-render on incremental render or preview
2+
console.log("Running post-render script for Algolia search index.");
3+
if (!Deno.env.get("QUARTO_PROJECT_RENDER_ALL")) {
4+
console.log(" Skipping custom attribute addition for Algolia search as this is not a full render.");
5+
Deno.exit(0);
6+
}
7+
console.log(" Adding custom attribute for Algolia search.");
8+
// This script adds a custom attribute to the Algolia search index for guides
19
const j = JSON.parse(Deno.readTextFileSync("_site/search.json"));
210
j.forEach((entry) => {
311
const crumb = entry.crumbs || [];

0 commit comments

Comments
 (0)