diff --git a/docusaurus.config.js b/docusaurus.config.js index e7d7f3418..640fb79d1 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -1,4 +1,5 @@ const path = require("path"); +const platformEnterpriseVersions = require("./platform-enterprise_versions.json"); import "dotenv/config"; import platform_enterprise_latest_version from "./platform-enterprise_latest_version.js"; import { @@ -7,6 +8,14 @@ import { getSeqeraPresetOptions } from "@seqera/docusaurus-preset-seqera"; +// Build the search filter_by dynamically so old platform-enterprise versions are +// excluded automatically whenever a new version is added to versions.json. +// versions.json is ordered newest-first; index 0 is the current/latest version. +const oldEnterpriseVersionTags = platformEnterpriseVersions + .slice(1) + .map((v) => `docs-platform-enterprise-${v}`); +const searchFilterBy = `docusaurus_tag:!=[default,doc_tag_doc_list,blog_posts_list,blog_tags_posts,doc_tags_list,blog_tags_list${oldEnterpriseVersionTags.length ? `,${oldEnterpriseVersionTags.join(",")}` : ""}]`; + export default async function createConfigAsync() { const changelog = { @@ -415,14 +424,29 @@ export default async function createConfigAsync() { }, typesenseSearchParameters: { query_by: 'content,hierarchy.lvl0,hierarchy.lvl1,hierarchy.lvl2,hierarchy.lvl3', - group_by: 'url_without_anchor', + group_by: 'url', group_limit: 1, - num_typos: 1, + per_page: 20, + num_typos: 2, prioritize_exact_match: true, - filter_by: 'docusaurus_tag:!=[default,doc_tag_doc_list,blog_posts_list,blog_tags_posts,doc_tags_list,blog_tags_list]', // TODO Remove once the scraper is updated + filter_by: searchFilterBy, // Old platform-enterprise versions excluded automatically via searchFilterBy above }, contextualSearch: false, placeholder: 'Search Seqera docs...', + // Override default productRoutes to fix the Nextflow tag. + // The default uses 'docs-default-current' but the Typesense index + // has 'docs-nextflow-current'. + productRoutes: [ + ['/platform-enterprise/', 'Platform Enterprise', 'platform-enterprise', null], + ['/platform-cloud/', 'Platform Cloud', 'platform-cloud', null], + ['/platform-cli/', 'Platform CLI', 'platform-cli', null], + ['/platform-api/', 'Platform API', 'platform-api', null], + ['/nextflow/', 'Nextflow', null, 'docs-nextflow-current'], + ['/multiqc/', 'MultiQC', 'multiqc', null], + ['/wave/', 'Wave', 'wave', null], + ['/fusion/', 'Fusion', 'fusion', null], + ['/changelog/', 'Changelog', null, null], + ], }, prism: { additionalLanguages: [ diff --git a/package-lock.json b/package-lock.json index 65f95aafd..6f55fff2a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@docusaurus/faster": "^3.9.2", "@rspack/core": "^1.4.11", - "@seqera/docusaurus-preset-seqera": "^1.0.25", + "@seqera/docusaurus-preset-seqera": "^1.0.26", "image-size": "^2.0.2", "postcss-import": "^16.1.1", "postcss-loader": "^8.1.1", @@ -5785,9 +5785,9 @@ "license": "MIT" }, "node_modules/@seqera/docusaurus-preset-seqera": { - "version": "1.0.25", - "resolved": "https://registry.npmjs.org/@seqera/docusaurus-preset-seqera/-/docusaurus-preset-seqera-1.0.25.tgz", - "integrity": "sha512-/pt7JRdP2XBCA0lu6f1eUaAIsEMTJ4T0di9VFs2SxhSx8f+FIaAsOPfaSj51qAOuCDZpNu0JyzmdrvWi5yfEkw==", + "version": "1.0.26", + "resolved": "https://registry.npmjs.org/@seqera/docusaurus-preset-seqera/-/docusaurus-preset-seqera-1.0.26.tgz", + "integrity": "sha512-IpScJZHH3ebYmDKEpOwFN0aRQtdLQKR5TukrGg/X+UIYsrtp/1lJuieGD3MqVtPOFppyGeYhGnMSSBP/J/h9Vw==", "license": "Apache-2.0", "dependencies": { "@docusaurus/core": "3.9.2", @@ -5804,7 +5804,7 @@ "@docusaurus/theme-common": "3.9.2", "@docusaurus/theme-search-algolia": "3.9.2", "@docusaurus/types": "3.9.2", - "@seqera/docusaurus-theme-seqera": "1.0.25", + "@seqera/docusaurus-theme-seqera": "1.0.26", "@tailwindcss/oxide": "^4.1.17", "docusaurus-plugin-llms": "^0.3.0", "docusaurus-plugin-openapi-docs": "^4.5.1", @@ -5825,9 +5825,9 @@ } }, "node_modules/@seqera/docusaurus-theme-seqera": { - "version": "1.0.25", - "resolved": "https://registry.npmjs.org/@seqera/docusaurus-theme-seqera/-/docusaurus-theme-seqera-1.0.25.tgz", - "integrity": "sha512-f5mFYeZfP7br3qbCl8mN3H7nr0sGOUqvBeOo/1OIgBr44jWnGb9s1A0Y8cDVUldHuN8f9WszhedO2zKdCTo2oA==", + "version": "1.0.26", + "resolved": "https://registry.npmjs.org/@seqera/docusaurus-theme-seqera/-/docusaurus-theme-seqera-1.0.26.tgz", + "integrity": "sha512-vxOdXvXTb4x0s8JWvEQN59wpES2tpzFNjaU9P3BK7V3RmKZWvI1PnqotZgJCscKcIhMdVa7BaakAiBxkCNuBiw==", "license": "Apache-2.0", "dependencies": { "@docusaurus/core": "3.9.2", @@ -5845,6 +5845,7 @@ "@docusaurus/utils-validation": "3.9.2", "@mdx-js/react": "^3.0.0", "@tailwindcss/postcss": "^4.1.17", + "algoliasearch-helper": "^3.0.0", "clsx": "^2.0.0", "infima": "0.2.0-alpha.45", "lodash": "^4.17.21", @@ -5857,6 +5858,7 @@ "rtlcss": "^4.1.0", "tailwindcss": "^4.1.17", "tslib": "^2.6.0", + "typesense-instantsearch-adapter": "^2.0.0", "utility-types": "^3.10.0" }, "engines": { diff --git a/package.json b/package.json index d54cb438d..012de1897 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "dependencies": { "@docusaurus/faster": "^3.9.2", "@rspack/core": "^1.4.11", - "@seqera/docusaurus-preset-seqera": "^1.0.25", + "@seqera/docusaurus-preset-seqera": "^1.0.26", "image-size": "^2.0.2", "postcss-import": "^16.1.1", "postcss-loader": "^8.1.1",