From 53315b285f06693a124fd231571be7fddf1d2a4b Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 24 Nov 2021 00:41:28 -0500 Subject: [PATCH] [Fleet] Override branch in doc links (#119514) (#119561) Co-authored-by: Jen Huang Co-authored-by: Lisa Cawley Co-authored-by: Jen Huang --- .../custom_integrations/server/language_clients/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/custom_integrations/server/language_clients/index.ts b/src/plugins/custom_integrations/server/language_clients/index.ts index 0ce45dbcfcd878..d18eddaf086279 100644 --- a/src/plugins/custom_integrations/server/language_clients/index.ts +++ b/src/plugins/custom_integrations/server/language_clients/index.ts @@ -151,7 +151,11 @@ export function registerLanguageClients( description: integration.description, type: 'ui_link', shipper: 'language_clients', - uiInternalPath: integration.docUrlTemplate.replace('{branch}', branch), + // Documentation for `main` branches is still published at a `master` URL. + uiInternalPath: integration.docUrlTemplate.replace( + '{branch}', + branch === 'main' ? 'master' : branch + ), isBeta: false, icons, categories: ['elastic_stack', 'custom', 'language_client'],