Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- summary: |
Fix changelog overview page detection to recognize non-date files beyond
the reserved names (summary, index, overview). When no reserved-name file
is present, the first non-date file in the changelog directory is now
treated as the overview page, allowing its frontmatter slug override to
propagate correctly to the V1 navigation tree.
type: fix
10 changes: 10 additions & 0 deletions packages/cli/docs-resolver/src/ChangelogNodeConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class ChangelogNodeConverter {
}[] = [];

let overviewPagePath: AbsoluteFilePath | undefined = undefined;
let fallbackOverviewPath: AbsoluteFilePath | undefined = undefined;
for (const absoluteFilepath of this.changelogFiles ?? []) {
const filename = last(absoluteFilepath.split("/"));
if (filename == null) {
Expand All @@ -56,6 +57,8 @@ export class ChangelogNodeConverter {
const nameWithoutExtension = filename.split(".")[0]?.toLowerCase();
if (nameWithoutExtension != null && RESERVED_OVERVIEW_PAGE_NAMES.includes(nameWithoutExtension)) {
overviewPagePath = absoluteFilepath;
} else if (fallbackOverviewPath == null) {
fallbackOverviewPath = absoluteFilepath;
}

continue;
Expand All @@ -68,6 +71,13 @@ export class ChangelogNodeConverter {
});
}

// Fall back to any non-date file as the overview when no reserved-name file is found.
// This handles changelogs where the overview page has a non-standard filename
// (e.g., "release-notes.mdx") and may carry a frontmatter slug override.
if (overviewPagePath == null && fallbackOverviewPath != null) {
overviewPagePath = fallbackOverviewPath;
}

const slug = opts.parentSlug.apply({
fullSlug: overviewPagePath != null ? this.markdownToFullSlug.get(overviewPagePath)?.split("/") : undefined,
skipUrlSlug: false, // changelog pages should always have a url slug
Expand Down
Loading