diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 5839ea4ac..c5a480a38 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 aaf1dfe1d..000000000 --- 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 4d3b9f8ba..000000000 --- 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 0119d38a5..000000000 --- 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 45d699ded..000000000 --- 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 22a7a53e7..255836a06 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 dcb4a0224..23438e7d1 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 36da40449..32cd3b2b1 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 5dd34c67e..000000000 --- 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 ddac63510..000000000 Binary files a/search-by-algolia.png and /dev/null differ