Skip to content

Commit

Permalink
Check SERVERLESS_DOCS links in Kibana
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl committed Nov 7, 2024
1 parent 4658579 commit 4ccfc2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build_docs.pl
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ sub check_kibana_links {
my $extractor = sub {
my $contents = shift;
return sub {
while ( $contents =~ m!`(\$\{(?:baseUrl|ELASTIC.+|KIBANA_DOCS|PLUGIN_DOCS|FLEET_DOCS|APM_DOCS|STACK_DOCS|SECURITY_SOLUTION_DOCS|STACK_GETTING_STARTED|APP_SEARCH_DOCS|ENTERPRISE_SEARCH_DOCS|INTEGRATIONS_DEV_DOCS|WORKPLACE_SEARCH_DOCS)\}[^`]+)`!g ) {
while ( $contents =~ m!`(\$\{(?:baseUrl|ELASTIC.+|KIBANA_DOCS|PLUGIN_DOCS|FLEET_DOCS|APM_DOCS|STACK_DOCS|SECURITY_SOLUTION_DOCS|STACK_GETTING_STARTED|APP_SEARCH_DOCS|ENTERPRISE_SEARCH_DOCS|INTEGRATIONS_DEV_DOCS|WORKPLACE_SEARCH_DOCS|SERVERLESS_DOCS)\}[^`]+)`!g ) {
my $path = $1;
$path =~ s/\$\{(?:DOC_LINK_VERSION|urlVersion)\}/$version/;
$path =~ s/\$\{(?:ECS_VERSION)\}/current/;
Expand All @@ -376,6 +376,7 @@ sub check_kibana_links {
$path =~ s!\$\{WORKPLACE_SEARCH_DOCS\}!en/workplace-search/$version/!;
$path =~ s!\$\{MACHINE_LEARNING_DOCS\}!en/machine-learning/$version/!;
$path =~ s!\$\{INTEGRATIONS_DEV_DOCS}!en/integrations-developer/current/!;
$path =~ s!\$\{SERVERLESS_DOCS}!/en/serverless/current/!;
# Replace the "https://www.elastic.co/guide/" URL prefix so that
# it becomes a file path in the built docs.
$path =~ s!\$\{(?:baseUrl|ELASTIC_WEBSITE_URL)\}guide/!!;
Expand Down

0 comments on commit 4ccfc2b

Please sign in to comment.