Skip to content

Commit

Permalink
docs: add versioned search (#9824)
Browse files Browse the repository at this point in the history
  • Loading branch information
pskelin authored Sep 6, 2024
1 parent f4ca863 commit 3b7b124
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/website/docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type * as Preset from '@docusaurus/preset-classic';
import packageJson from "./package.json";


console.log(process.env.DEPLOYMENT_TYPE); // eslint-disable-line
console.log("DEPLOYMENT_TYPE", process.env.DEPLOYMENT_TYPE); // eslint-disable-line

const LATEST_URL_PARTH = "/ui5-webcomponents/";
const NIGHTLY_URL_PARTH = "/ui5-webcomponents/nightly/";
Expand All @@ -28,6 +28,8 @@ const getFullURL = () => {
return DEVELOPMENT_ENVIRONMENT ? `${BASE_URL}` : `https://sap.github.io${BASE_URL}`
}

// ["v1", "nightly", "current"]
const siteVersion = LATEST_DEPLOYMENT ? (packageJson.version.startsWith("1") ? "v1" : "current") : "nightly";

const config: Config = {
customFields: {
Expand Down Expand Up @@ -96,7 +98,9 @@ const config: Config = {
contextualSearch: true,

// Optional: Algolia search parameters
searchParameters: {},
searchParameters: {
facetFilters: [`version:${siteVersion}`],
},

// Optional: path for search page that enabled by default (`false` to disable it)
searchPagePath: 'search',
Expand Down

0 comments on commit 3b7b124

Please sign in to comment.