Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tools/algolia-add-custom-attribute.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
// don't run the post-render on incremental render or preview
console.log("Running post-render script for Algolia search index.");
if (!Deno.env.get("QUARTO_PROJECT_RENDER_ALL")) {
console.log(" Skipping custom attribute addition for Algolia search as this is not a full render.");
Deno.exit(0);
}
console.log(" Adding custom attribute for Algolia search.");
// This script adds a custom attribute to the Algolia search index for guides
const j = JSON.parse(Deno.readTextFileSync("_site/search.json"));
j.forEach((entry) => {
const crumb = entry.crumbs || [];
Expand Down