Skip to content

Commit 22139ab

Browse files
authored
Exclude Cloud APIs from Self-Managed docs search (#333)
* Exclude Cloud APIs from Self-Managed docs search * Apply coderabbit suggestions
1 parent 63bf1ab commit 22139ab

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/partials/algolia-script.hbs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ const COMPONENT_NAME = `{{{page.component.title}}}`.trim();
4141
/**
4242
* The “catalog” of product/API tags we want available by default.
4343
* For Cloud, we intentionally exclude "Admin API" from defaults.
44+
* For Self-Managed, we intentionally exclude Cloud Control Plane/Data Plane APIs from defaults.
4445
*/
45-
const INITIAL_TAGS =
46-
COMPONENT_NAME === 'Cloud'
47-
? ['Labs', 'Schema Registry API', 'HTTP Proxy API', 'Cloud Control Plane API', 'Cloud Data Plane API']
48-
: ['Labs', 'Connect', 'Admin API', 'Schema Registry API', 'HTTP Proxy API', 'Cloud Control Plane API', 'Cloud Data Plane API'];
46+
const TAGS_BY_COMPONENT = {
47+
Cloud: ['Labs', 'Schema Registry API', 'HTTP Proxy API', 'Cloud Control Plane API', 'Cloud Data Plane API'],
48+
'Self-Managed': ['Labs', 'Connect', 'Admin API', 'Schema Registry API', 'HTTP Proxy API'],
49+
};
50+
const DEFAULT_TAGS = ['Labs', 'Connect', 'Admin API', 'Schema Registry API', 'HTTP Proxy API', 'Cloud Control Plane API', 'Cloud Data Plane API'];
51+
const INITIAL_TAGS = TAGS_BY_COMPONENT[COMPONENT_NAME] || DEFAULT_TAGS;
4952
5053
/** Version added to the “View all” link to scope whole-site search. */
5154
const VERSION = PRERELEASE === 'true'

0 commit comments

Comments
 (0)