Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

Commit 97db133

Browse files
Publish group overview pages as the section index (index.md)
A <Group>/<Group>.md overview page is now emitted as <Group>/index.md so it renders as the group's landing page (with navigation.indexes) instead of a page nested under the group. Nested groups supported; other pages unchanged. Adds an Action-Test assertion. Addresses PSModule/Process-PSModule#371.
1 parent fb5d349 commit 97db133

2 files changed

Lines changed: 27 additions & 0 deletions

File tree

.github/workflows/Action-Test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,23 @@ jobs:
6060
Name: PSModuleTest
6161
WorkingDirectory: tests/srcTestRepo
6262

63+
- name: Verify group overview pages publish as section index
64+
shell: pwsh
65+
run: |
66+
$docs = 'tests/srcTestRepo/outputs/docs'
67+
$expected = @('PSModule/index.md', 'SomethingElse/index.md')
68+
$unexpected = @('PSModule/PSModule.md', 'SomethingElse/SomethingElse.md')
69+
$failed = $false
70+
foreach ($rel in $expected) {
71+
if (Test-Path (Join-Path $docs $rel)) { Write-Host "OK present: $rel" }
72+
else { Write-Host "ERR missing: $rel"; $failed = $true }
73+
}
74+
foreach ($rel in $unexpected) {
75+
if (Test-Path (Join-Path $docs $rel)) { Write-Host "ERR should not exist: $rel"; $failed = $true }
76+
else { Write-Host "OK absent: $rel" }
77+
}
78+
if ($failed) { throw 'Group overview pages were not published as section index (index.md).' }
79+
6380
- name: Lint documentation
6481
uses: super-linter/super-linter/slim@4ce20838b8ab83717e78138c5b3a1407148e0918 # v8.7.0
6582
env:

src/helpers/Build-PSModuleDocumentation.ps1

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,16 @@ $(($successfulCommands | ForEach-Object { "- ``$($_.CommandName)`` `n" }) -join
231231
Write-Host " Path: $file"
232232

233233
$docsFilePath = ($file.FullName).Replace($PublicFunctionsFolder.FullName, $docsOutputFolder)
234+
235+
# A group overview page named after its folder (e.g. Auth/Auth.md) is published as the
236+
# section landing page (Auth/index.md) so the navigation shows it when the group is
237+
# selected, instead of listing it as a separate page nested under the group.
238+
$parentFolderName = Split-Path -Path (Split-Path -Path $file.FullName -Parent) -Leaf
239+
if ($file.BaseName -eq $parentFolderName) {
240+
$docsFilePath = Join-Path -Path (Split-Path -Path $docsFilePath -Parent) -ChildPath 'index.md'
241+
Write-Host ' Group overview page detected - publishing as section index (index.md)'
242+
}
243+
234244
Write-Host " MD path: $docsFilePath"
235245
$docsFolderPath = Split-Path -Path $docsFilePath -Parent
236246
$null = New-Item -Path $docsFolderPath -ItemType Directory -Force

0 commit comments

Comments
 (0)