From 26b135a3f33eac340757c08aea6f6d5dba66f32c Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 1 May 2026 17:07:17 +0000 Subject: [PATCH] Replace Algolia search with Quarto built-in search Algolia hosting is no longer available, so the navbar overlay search is broken on quarto.org and prerelease.quarto.org. Drop the `algolia:` configuration so the site falls back to Quarto's built-in client-side search over the locally generated `search.json` index -- the documented default behavior, no extra config needed. Also remove the now-dead supporting tooling: - _tools/algolia-add-custom-attribute.ts (post-render index augmenter) - .github/workflows/upload-index.yml (nightly index upload) - .github/workflows/test-algolia-upload.yml - .github/workflows/upload-algolia.rb - .github/workflows/algolia-config.json - search-by-algolia.png (orphan asset) Drop the matching bullet/row in .github/workflows/README.md and _tools/README.md so the inventory stays accurate. https://claude.ai/code/session_01GppXdbFEV144FzLi6mVLbG --- .github/workflows/README.md | 5 -- .github/workflows/algolia-config.json | 57 ---------------------- .github/workflows/test-algolia-upload.yml | 26 ---------- .github/workflows/upload-algolia.rb | 36 -------------- .github/workflows/upload-index.yml | 42 ---------------- _quarto-prerelease-docs.yml | 3 -- _quarto.yml | 8 --- _tools/README.md | 1 - _tools/algolia-add-custom-attribute.ts | 15 ------ search-by-algolia.png | Bin 1152 -> 0 bytes 10 files changed, 193 deletions(-) delete mode 100644 .github/workflows/algolia-config.json delete mode 100644 .github/workflows/test-algolia-upload.yml delete mode 100644 .github/workflows/upload-algolia.rb delete mode 100644 .github/workflows/upload-index.yml delete mode 100644 _tools/algolia-add-custom-attribute.ts delete mode 100644 search-by-algolia.png diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 5839ea4acb..c5a480a384 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -30,11 +30,6 @@ Note that technically, is also a deploy preview on Netli - For `prerelease` branch, we use `git cherry-pick` the commit from main following previous above step. - Then we trigger the `publish.yml` workflow with `workflow_call` event trigger for each of the branch. -- `upload-index.yml` - This workflow is triggered by a cron schedule. It updates the indexes for Algolia search engine, which powers the sites search. - - `search.json` is built when the website is rendered and then it is deployed to the website. - - This index file is retrieved on deployed website to be updated on Algolia. - - Both `quarto.org` and `prerelease.quarto.org` indexes are updated in the same run - they each use one specific algolia index - - `draft-check.yml` - A lightweight workflow that detects `draft: true` pages among changed `.qmd` files. Runs on all PRs to `main` and `prerelease` with no `paths-ignore`, so it always creates a status check. - Uses the reusable composite action at `.github/workflows/actions/detect-drafts/`. - Configured as a required status check on `main` (`check-drafts` job), blocking merge until `draft: true` is removed. diff --git a/.github/workflows/algolia-config.json b/.github/workflows/algolia-config.json deleted file mode 100644 index aaf1dfe1dc..0000000000 --- a/.github/workflows/algolia-config.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "settings": { - "minWordSizefor1Typo": 4, - "minWordSizefor2Typos": 8, - "hitsPerPage": 20, - "maxValuesPerFacet": 100, - "searchableAttributes": [ - "unordered(title)", - "unordered(section)", - "unordered(text)", - "unordered(href)" - ], - "numericAttributesForFiltering": null, - "attributesToRetrieve": null, - "unretrievableAttributes": null, - "optionalWords": null, - "attributesForFaceting": null, - "attributesToSnippet": null, - "attributesToHighlight": null, - "paginationLimitedTo": 1000, - "attributeForDistinct": null, - "exactOnSingleWordQuery": "attribute", - "ranking": [ - "typo", - "geo", - "words", - "filters", - "proximity", - "attribute", - "exact", - "custom" - ], - "customRanking": [ - "desc(guide)" - ], - "separatorsToIndex": "\"_\"", - "removeWordsIfNoResults": "none", - "queryType": "prefixLast", - "highlightPreTag": "", - "highlightPostTag": "", - "alternativesAsExact": [ - "ignorePlurals", - "singleWordSynonym" - ] - }, - "rules": [], - "synonyms": [ - { - "type": "synonym", - "synonyms": [ - "math", - "maths" - ], - "objectID": "ai_optim_515edecd-2e6b-4a7b-8a92-7b17df3745e8" - } - ] -} \ No newline at end of file diff --git a/.github/workflows/test-algolia-upload.yml b/.github/workflows/test-algolia-upload.yml deleted file mode 100644 index 4d3b9f8ba2..0000000000 --- a/.github/workflows/test-algolia-upload.yml +++ /dev/null @@ -1,26 +0,0 @@ -# Test workflow for Algolia upload - uses test_QUARTO index only -name: Test Algolia Upload -on: - workflow_dispatch: -jobs: - test-upload: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v6 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.0.2 - - name: Install Algolia API Dependencies - run: | - gem install algolia -v '~> 3.0' - - name: Upload Index to test_QUARTO - run: | - ruby .github/workflows/upload-algolia.rb - env: - ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} - ALGOLIA_APP_ID: ZPJB5I1QN7 - ALGOLIA_INDEX: test_QUARTO - QUARTO_INDEX_PATH: search.json - QUARTO_INDEX_URL: https://quarto.org/search.json diff --git a/.github/workflows/upload-algolia.rb b/.github/workflows/upload-algolia.rb deleted file mode 100644 index 0119d38a5e..0000000000 --- a/.github/workflows/upload-algolia.rb +++ /dev/null @@ -1,36 +0,0 @@ -require 'json' -require 'algolia' -require 'open-uri' - -apiKey = ENV["ALGOLIA_API_KEY"] -appId = ENV["ALGOLIA_APP_ID"] -indexName = ENV["ALGOLIA_INDEX"] -indexFile = ENV["QUARTO_INDEX_PATH"] -indexUrl = ENV["QUARTO_INDEX_URL"] - -# Download the index from deployed website -download = URI.open(indexUrl) -IO.copy_stream(download, indexFile) - -client = Algolia::SearchClient.create(appId, apiKey) -file = File.read(indexFile) -records = JSON.parse(file) - -# The API client automatically batches your records -client.replace_all_objects(indexName, records) - -# Apply settings from config file -configFile = File.read('.github/workflows/algolia-config.json') -config = JSON.parse(configFile) - -client.set_settings(indexName, config['settings']) - -# Apply synonyms if present -if config['synonyms'] && !config['synonyms'].empty? - client.save_synonyms(indexName, config['synonyms'], nil, true) -end - -# Apply rules if present -if config['rules'] && !config['rules'].empty? - client.save_rules(indexName, config['rules'], nil, true) -end diff --git a/.github/workflows/upload-index.yml b/.github/workflows/upload-index.yml deleted file mode 100644 index 45d699ded4..0000000000 --- a/.github/workflows/upload-index.yml +++ /dev/null @@ -1,42 +0,0 @@ -# Uploads index to our Algolia Index -name: Upload Index -on: - workflow_dispatch: - repository_dispatch: - schedule: - - cron: "0 0 * * *" -jobs: - upload-index: - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v6 - - name: Setup Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: 3.0.2 - - name: Install Algolia API Dependencies - run: | - gem install algolia -v '~> 3.0' - - name: Upload Index for release website - run: | - pwd - ruby .github/workflows/upload-algolia.rb - env: - ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} - ALGOLIA_APP_ID: ZPJB5I1QN7 - ALGOLIA_INDEX: prod_QUARTO - QUARTO_INDEX_PATH: search.json - QUARTO_INDEX_URL: https://quarto.org/search.json - - name: Upload Index for pre-release website - run: | - pwd - ruby .github/workflows/upload-algolia.rb - env: - ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }} - ALGOLIA_APP_ID: ZPJB5I1QN7 - ALGOLIA_INDEX: prerelease_QUARTO - QUARTO_INDEX_PATH: search.json - QUARTO_INDEX_URL: https://prerelease.quarto.org/search.json - - diff --git a/_quarto-prerelease-docs.yml b/_quarto-prerelease-docs.yml index 22a7a53e7b..255836a06f 100644 --- a/_quarto-prerelease-docs.yml +++ b/_quarto-prerelease-docs.yml @@ -13,9 +13,6 @@ website: content: "Pre-release (v{{< meta version >}}) Documentation: [Download v{{< meta version >}}](/docs/download/prerelease.qmd), [Current Release Docs](http://quarto.org) " navbar: pinned: true - search: - algolia: - index-name: prerelease_QUARTO format: html: diff --git a/_quarto.yml b/_quarto.yml index dcb4a0224f..23438e7d19 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -1,8 +1,6 @@ project: type: website output-dir: _site - post-render: - - _tools/algolia-add-custom-attribute.ts resources: - "/docs/download/_download.json" - "/docs/download/_prerelease.json" @@ -31,12 +29,6 @@ website: search: show-item-context: true type: overlay - algolia: - index-name: prod_QUARTO - application-id: ZPJB5I1QN7 - search-only-api-key: 49ee55c4d51cbb25a06182d9eef55814 - analytics-events: true - show-logo: true page-footer: left: | Proudly supported by diff --git a/_tools/README.md b/_tools/README.md index 36da40449a..32cd3b2b1c 100644 --- a/_tools/README.md +++ b/_tools/README.md @@ -7,7 +7,6 @@ Utility scripts for the quarto-web project. Run with `quarto run` (TypeScript, R | Script | Language | Description | |--------|----------|-------------| | `publish-date.ts` | TypeScript | Set a blog post date to today and rename its directory to match | -| `algolia-add-custom-attribute.ts` | TypeScript | Post-render hook: adds custom attributes to Algolia search index | | `reference.ts` | TypeScript | Generate reference documentation | | `reference-cli-generate-md.R` | R | Generate CLI reference markdown | | `gallery-screenshot.R` | R | Capture gallery screenshots | diff --git a/_tools/algolia-add-custom-attribute.ts b/_tools/algolia-add-custom-attribute.ts deleted file mode 100644 index 5dd34c67e1..0000000000 --- a/_tools/algolia-add-custom-attribute.ts +++ /dev/null @@ -1,15 +0,0 @@ -// 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 || []; - entry.guide = crumb[0] === "Guide" ? 1 : 0; -}) -Deno.writeTextFileSync("_site/search.json", JSON.stringify(j, null, 2)); - \ No newline at end of file diff --git a/search-by-algolia.png b/search-by-algolia.png deleted file mode 100644 index ddac63510e20e7334f6d62c06afabbbcf5585f80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1152 zcmV-`1b_R9P)K`RA~QPWRqNDlv8N`Tw|0}X8%=X|5IlFU1F6`X#Z1Z z|5RxIQ)mBJV3%BDlw4z!Tw{||X#ZVhmQrZ{Q)vHMWtCiGlv8K_RA~QQWR(B^|EsnC z;^zNeasPCL|J2$4_4fbD(Eo{-|JB<6X?y>frT>49|G&ro1>dfF0000VbW%=J0D$mt z5Wv8IKtQLZ@Nh6tU?7mc&>+y@P=7yQ;4qLv%_w*P00V$YL_t(Y$K{u4d!jH9fH^`4 z_o;xW55Ze&_y7O9ok>89qTSYQ_ruNynM?w_&Xu5P|D%w!xtHpGU7a=T@l(RgVBZWn z#@UQ8+08RhCTF8G{5DWy6x99_Xwo#sw}D>R-gmp*@ikELHBd4m!(cM|2z1q+_J`L% zHD=$2KBknKAAmaC83sCk26{Yfnr8dH{e0*X1r)r~71!mp1*QD&fwt?nRg1FPsGxQZ zgLy>;(8R;6&OPD44Ap1=%^FMm;!SAQ{3%9LJZjO0wvV%j@nR-HFIE60i-(}U-q!8@ zv^wm8SOt~b*#$H-2A|i1+JQC#v|AE@%BS6fOwRcdt_56OWHWs(tyB)U-h;+qj5UJG zV8KGo(L;NBYtHBGq1`E2Dk!iJPIQNClt_{g$b;fgGxCS{*1Z4 zh>^v0oF!m5+}BHhf?;)O1iQ{Y-h_{*nVj_O0A>b!*8d>0I{HsPiUx@wQ&cYi*% zzf@4hScqc@3a?Lk(0SL3a=5CX39F)Rr8aT7KhdzJXaT`?mQY+6?NY>lD5e1ve<}R2 zVhWKbD(I=jfjKny2ueCo zlTQj)8v{jAK_TddXM3Lmg_O2zY!^&+s}gwJf(#fv=n#4ZG?t;qazcG1^rE9Gp|=`? zh&5xO2Nd!4Ig|~P`HG++=4{_3{H19Y5c&nDEz z77A?%8|Vhw)OC9T2WC}O_07l=?J29$Ia