Skip to content

Publish group overview pages as the section index (index.md)#53

Open
Marius Storhaug (MariusStorhaug) wants to merge 2 commits into
mainfrom
fix/group-overview-index-page
Open

Publish group overview pages as the section index (index.md)#53
Marius Storhaug (MariusStorhaug) wants to merge 2 commits into
mainfrom
fix/group-overview-index-page

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Jul 9, 2026

Copy link
Copy Markdown
Member

Publishes a group overview page as the section index instead of a page nested under the group.

Problem

src/functions/public/<Group>/<Group>.md was copied to outputs/docs/<Group>/<Group>.md, which renders as a page inside the group (e.g. /Functions/PSModule/PSModule/) rather than the group's landing page. With navigation.indexes enabled in the site config, the section header had no index.md to link to, so clicking the group just expanded it.

Change

In Build-PSModuleDocumentation.ps1, the "Move markdown files from public functions folder to docs output folder" step now publishes a group overview page as the section index (<Group>/index.md). The overview can be authored two ways:

  • <Group>/<Group>.md (basename matches the folder) — mapped to <Group>/index.md. Keeps the descriptive, folder-matching name used by Template-PSModule.
  • <Group>/index.md — published as-is.

If a folder somehow contains both, the explicit index.md wins and the <Group>.md stays a normal page (no overwrite). Nested groups work (Auth/Context/Context.mdAuth/Context/index.md). Other hand-authored pages (e.g. PSModule/Notes.md) are unchanged.

Result: PSModule/PSModule.md/Functions/PSModule/, shown when the group is selected.

Test

Action-Test.yml asserts the fixture group overviews publish as index.md (PSModule via the mapped <Group>.md path, SomethingElse via the explicit index.md path) and no longer as <Group>.md.

Addresses PSModule/Process-PSModule#371 (issues are disabled on this repo, so tracked there).

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the documentation build pipeline so “group overview” markdown files (where the file basename matches its containing folder) are published as the section landing page (index.md), enabling navigation.indexes to link group headers to real content.

Changes:

  • In Build-PSModuleDocumentation.ps1, detect <Group>/<Group>.md (including nested groups) and publish it as <Group>/index.md.
  • In Action-Test.yml, add a CI assertion that fixture group overviews publish as index.md and no longer as <Group>.md.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/helpers/Build-PSModuleDocumentation.ps1 Adds logic to remap folder-matching “group overview” pages to index.md in the docs output.
.github/workflows/Action-Test.yml Adds a PowerShell validation step ensuring the new index.md publishing behavior is enforced in CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings July 9, 2026 12:00
The section index can now be authored either as <Group>/<Group>.md (mapped to index.md) or as <Group>/index.md directly (published as-is). If a folder has both, the explicit index.md wins and the <Group>.md stays a normal page. Fixture: SomethingElse now uses index.md to cover the passthrough path (PSModule still covers the mapped path).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

Comment on lines +238 to +242
$parentFolderName = Split-Path -Path (Split-Path -Path $file.FullName -Parent) -Leaf
if ($file.BaseName -eq $parentFolderName) {
$docsFilePath = Join-Path -Path (Split-Path -Path $docsFilePath -Parent) -ChildPath 'index.md'
Write-Host ' Group overview page detected - publishing as section index (index.md)'
}
Copilot AI review requested due to automatic review settings July 9, 2026 12:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

Comment on lines +229 to +232
$explicitIndexFolders = @(
Get-ChildItem -Path $PublicFunctionsFolder -Recurse -Force -Filter 'index.md' |
ForEach-Object { $_.Directory.FullName }
)
Comment on lines +246 to +251
if ($file.Name -eq 'index.md') {
Write-Host ' Section index page (index.md) - publishing as-is'
} elseif ($file.BaseName -eq $parentFolderName -and $parentFolder -notin $explicitIndexFolders) {
$docsFilePath = Join-Path -Path (Split-Path -Path $docsFilePath -Parent) -ChildPath 'index.md'
Write-Host ' Group overview page detected - publishing as section index (index.md)'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants