Skip to content

Commit

Permalink
[doc-links] Ensure correct doc links from main branch (#116652)
Browse files Browse the repository at this point in the history
Until all repos are switched over to using a "main" branch, all the doc
URLs are still published as the "master" version. This also gives us a
single place to change once we start publishing them as "main".
  • Loading branch information
gtback authored Oct 29, 2021
1 parent ba367bc commit 535a7b3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export class DocLinksService {
public setup() {}

public start({ injectedMetadata }: StartDeps): DocLinksStart {
const DOC_LINK_VERSION = injectedMetadata.getKibanaBranch();
const kibanaBranch = injectedMetadata.getKibanaBranch();
// Documentation for `main` branches is still published at a `master` URL.
const DOC_LINK_VERSION = kibanaBranch === 'main' ? 'master' : kibanaBranch;
const ELASTIC_WEBSITE_URL = 'https://www.elastic.co/';
const ELASTICSEARCH_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/elasticsearch/reference/${DOC_LINK_VERSION}/`;
const KIBANA_DOCS = `${ELASTIC_WEBSITE_URL}guide/en/kibana/${DOC_LINK_VERSION}/`;
Expand Down

0 comments on commit 535a7b3

Please sign in to comment.