"
- }
- $listHtml = $listItems -join "`n"
-
- $templatePath = '.github/version-picker-template.html'
- if (-not (Test-Path $templatePath)) {
- Write-Error "Template file '$templatePath' not found. This file is required."
- exit 1
- }
- $template = Get-Content $templatePath -Raw
- $html = $template -replace '\{\{TITLE\}\}', $title `
- -replace '\{\{VERSION_LIST\}\}', $listHtml
-
+ # Build the HTML as a string array joined with LF. Avoids a
+ # PowerShell here-string whose unindented inner lines would
+ # break the surrounding YAML literal-block scalar (they'd
+ # drop below the block's required indentation and terminate
+ # the scalar prematurely). Use a relative `versions/latest/`
+ # link so it resolves under the GitHub Pages project path
+ # `//`.
+ $htmlLines = @(
+ '',
+ '',
+ '',
+ ' ',
+ ' ',
+ " $title",
+ ' ',
+ ' ',
+ ' ',
+ " ",
+ '',
+ '',
+ '
Redirecting to the latest documentation…
',
+ ' ',
+ '',
+ ''
+ )
+ $html = $htmlLines -join "`n"
$html | Set-Content -Path (Join-Path $outDir 'index.html') -Encoding utf8NoBOM
- Write-Host "Generated index.html with $($versions.Count) version link(s)."
+ Write-Host "Generated root index.html (meta-refresh → versions/latest/)."
- name: Deploy all versioned docs to gh-pages at root
# Publishes the entire all_version_docs/ output directory to gh-pages
# at the site root. keep_files: true preserves any other content
# already present on the branch (CNAME, root assets, etc.).
- uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
+ uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ runner.temp }}/all_version_docs
diff --git a/.github/workflows/docfx.yaml b/.github/workflows/docfx.yaml
index b7ecab0..9018545 100644
--- a/.github/workflows/docfx.yaml
+++ b/.github/workflows/docfx.yaml
@@ -21,6 +21,11 @@ on:
required: false
type: boolean
default: true
+ overlay_canonical_docs_assets:
+ description: 'Before docfx build, overlay docfx_project/{public,versions.json,logo.svg,docfx.json} from origin/main onto the checked-out ref. Lets you backfill the canonical version-picker UI onto older tags whose original docfx_project predated it. Leave on for old-tag rebuilds; harmless no-op when running from main.'
+ required: false
+ type: boolean
+ default: true
# Manual trigger for ad-hoc builds or dry-runs.
# Leave 'version' blank to use the selected branch or tag name as the destination.
workflow_dispatch:
@@ -37,6 +42,10 @@ on:
description: 'Also deploy to the site root (/) and versions/latest/ (uncheck when rebuilding older versions)'
type: boolean
default: true
+ overlay_canonical_docs_assets:
+ description: 'Before docfx build, overlay docfx_project/{public,versions.json,logo.svg,docfx.json} from origin/main onto the checked-out ref. Lets you backfill the canonical version-picker UI onto older tags whose original docfx_project predated it. Leave on for old-tag rebuilds; harmless no-op when running from main.'
+ type: boolean
+ default: true
permissions:
contents: read # Default to read-only; the build-and-deploy job overrides with write
@@ -56,6 +65,67 @@ jobs:
fetch-depth: 0 # Full history needed to enumerate all v* tags
persist-credentials: false
+ # When backfilling docs for a tag that predates the canonical
+ # version-picker assets, the checked-out tag has no
+ # docfx_project/public/version-picker.js and its docfx.json
+ # has no picker-bootstrap ",
+ '',
+ '',
+ '