Skip to content

Commit

Permalink
Ensure that spec front matter redirect path gets patched too (open-te…
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Jan 22, 2025
1 parent a78c36e commit 65e2140
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions scripts/content-modules/adjust-pages.pl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ ($$)
if $specVersTest && !$patchMsgCount{$patchID}++;
}

sub patchAttrNaming($$) {
my ($ARGV, $__) = @_;
$_ = $__;
my $semconv_attr_naming = '(/docs/specs/semconv/general)/naming/';
if ($ARGV =~ /^tmp\/otel\/specification/ && /$semconv_attr_naming/) {
s|$semconv_attr_naming|$1/attribute-naming/|g;
printPatchInfoIf("2025-01-22-attribute-naming", $semconvVers ne "1.29.0");
}
return $_;
}

# main

while(<>) {
Expand All @@ -84,6 +95,7 @@ ($$)
if (/^<!---? Hugo/) {
while(<>) {
last if /^-?-->/;
$_ = patchAttrNaming($ARGV, $_); # TEMPORARY patch
$frontMatterFromFile .= $_;
}
next;
Expand Down Expand Up @@ -137,11 +149,7 @@ ($$)
printPatchInfoIf("2025-01-22-attribute-naming.md", $semconvVers ne "1.29.0");
}

my $semconv_attr_naming = '(/docs/specs/semconv/general)/naming/';
if ($ARGV =~ /^tmp\/otel\/specification/ && /$semconv_attr_naming/) {
s|$semconv_attr_naming|$1/attribute-naming/|g;
printPatchInfoIf("2025-01-22-attribute-naming", $semconvVers ne "1.29.0");
}
$_ = patchAttrNaming($ARGV, $_); # TEMPORARY patch

s|\(https://github.com/open-telemetry/opentelemetry-specification\)|($specBasePath/otel/)|;
s|(\]\()/specification/|$1$specBasePath/otel/)|;
Expand Down

0 comments on commit 65e2140

Please sign in to comment.