Skip to content

Commit c97d745

Browse files
committed
fix banner
1 parent f2b0710 commit c97d745

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

releaseDocs.ps1

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -43,36 +43,37 @@ Copy-Item "$SOURCE_DIR\_site\*" .\ -Recurse -force
4343
if ($betaSuffix -eq '-beta') {
4444
write-host "Injecting beta header into HTML files"
4545
$metadataPath = Join-Path $SOURCE_DIR "source-version-metadata.json"
46-
$metadataSuffix = ""
46+
$version = ""
47+
$timestamp = ""
4748
if (Test-Path $metadataPath) {
4849
try {
4950
$metadata = Get-Content $metadataPath -Raw | ConvertFrom-Json
5051
$version = $metadata.ProductVersion
5152
if (-not $version) { $version = $metadata.AssemblyVersion }
5253
$timestamp = $metadata.Timestamp
53-
if ($version -or $timestamp) {
54-
$metadataSuffix = " (Version: $version; Date: $timestamp)"
55-
}
5654
} catch {
5755
write-host "Unable to read source-version-metadata.json; continuing without metadata"
5856
}
5957
}
6058

59+
$betaCss = '<style>.navbar { top: 50px !important; } body { padding-top: 100px !important; }</style>'
60+
6161
$betaHeaderHtml = @"
62-
<div style="background: #fff3cd; border-bottom: 2px solid #ffc107; padding: 12px 0; position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 4px rgba(0,0,0,0.1);">
63-
<div class="container" style="text-align: center;">
64-
<p style="margin: 0; color: #856404; font-weight: 500; font-size: 14px;">
65-
<strong>⚠️ Beta / Prerelease Documentation</strong> - This documentation is subject to change and may not reflect the final product.$metadataSuffix
66-
</p>
62+
<div style="background: #fff3cd; border-bottom: 3px solid #ffc107; padding: 12px 15px; width: 100%; box-sizing: border-box; text-align: center; color: #856404; font-weight: 700; font-size: 14px; position: fixed; top: 0; left: 0; right: 0; z-index: 99999;">
63+
⚠️ Beta / Prerelease Documentation - Subject to change. (V: $version | $timestamp)
6764
</div>
68-
</div>
6965
"@
7066

7167
Get-ChildItem -Recurse -Filter "*.html" | ForEach-Object {
72-
$content = Get-Content $_.FullName -Raw
73-
# Insert beta header after <body> tag
74-
$newContent = $content -replace '(<body[^>]*>)', "`$1`n$betaHeaderHtml"
75-
Set-Content -Path $_.FullName -Value $newContent -Encoding UTF8
68+
$content = Get-Content $_.FullName -Raw -Encoding UTF8
69+
70+
# Inject CSS into <head> to offset the navbar below the banner
71+
$content = $content -replace '(</head>)', "$betaCss`n`$1"
72+
73+
# Insert beta banner right after <body> tag
74+
$content = $content -replace '(<body[^>]*>)', "`$1`n$betaHeaderHtml"
75+
76+
Set-Content -Path $_.FullName -Value $content -Encoding UTF8
7677
}
7778
}
7879

0 commit comments

Comments
 (0)