Skip to content

⚙️ [Maintenance]: Markdown pages can carry both a front matter title and a body heading - #39

Merged
Marius Storhaug (MariusStorhaug) merged 1 commit into
mainfrom
maintenance-38-markdown-lint-md025
Aug 9, 2026
Merged

⚙️ [Maintenance]: Markdown pages can carry both a front matter title and a body heading#39
Marius Storhaug (MariusStorhaug) merged 1 commit into
mainfrom
maintenance-38-markdown-lint-md025

Conversation

@MariusStorhaug

Copy link
Copy Markdown
Member

Markdown pages in repositories generated from this template can now carry both a front matter title: and a body # Heading without the linter objecting. MkDocs keeps using the front matter title for navigation and the page title, and the body heading keeps rendering on github.com, where front matter is shown as a table rather than a title.

Fixed: A front matter title is no longer counted as a second top-level heading

The markdown linter shipped with the template applied markdownlint's default front_matter_title pattern, so a front matter title: was treated as the document's top-level heading. Any page that also opened with # Heading was reported as MD025/single-title/single-h1 Multiple top-level headings in the same document, and the author was pushed toward dropping one of the two — losing either correct site navigation or a readable page on GitHub.

Nothing needs to change in your repository. Repositories generated from the template inherit the fix, and existing repositories pick it up the next time they take the template's linter configuration.

MD025 still does its job: a page with two body # Heading lines is reported exactly as before.


Technical details

.github/linters/.markdown-lint.yml gains one block in the "Rules by id" section, in numeric order between MD024 and MD026:

MD025:
front_matter_title: ''# Allow a body H1 alongside the front matter title
  • Empty pattern rather than MD025: false.frontMatterHasTitle() in markdownlint treats a defined-but-falsy pattern as "ignore front matter" while leaving the rest of the rule active, so a genuinely duplicated body # Heading is still reported. Disabling the rule outright would stop catching that too, which is a real defect rather than a formatting preference.
  • Converges with MSXOrg/docs, which carries front_matter_title: "" with the same comment in its copy of this file. Single quotes are used here to match the one existing quoted value in this file (punctuation: '.,;:!。,;:'); '' and "" are the same empty YAML scalar, and markdownlint sees an identical value either way.
  • No other rule was touched. The wider drift from MSXOrg/docs — MD013 line length (808 vs 3000), MD041, MD051, MD060 — is visible but deliberately out of scope.
  • PSModule/Markdown carries a byte-identical copy of this file and hit this exact problem in 📖 [Docs]: Markdown object model specified as a section tree Markdown#33, where title: had to be stripped from three documentation files to get a green lint run. Fixing the template is what stops that repeating in every module repository.

Verification. Throwaway fixtures outside the repository, ephemeral npx, nothing added to the repo. Run against both markdownlint-cli@0.45.0 (the CLI super-linter drives) and markdownlint-cli2@0.23.2 (markdownlint v0.41.1); the two agree on every case.

CaseConfigResult
Front matter title: + body # HeadingbeforeMD025 reported at the body heading — reproduces the bug
Front matter title: + body # HeadingafterClean, exit 0
Two body # Heading linesafterMD025 still reported at the second heading
The repository's own 8 Markdown filesafterClean, exit 0

Implementation plan progress: both plan sections in #38 — configuration and verification — are complete. Nothing deferred.

Changed surfaceStandards checkedFramework docs checkedResult
.github/linters/** (linter configuration)MSXOrg Coding StandardsRepository DefaultsAligned

Issue convergence sweep: the scope was every open issue in PSModule/Template-PSModule. #38 is the only one, and it is the closing issue for this pull request.

Relevant issues (or links)

… linter config
Set MD025 front_matter_title to an empty pattern so a front matter title:
is no longer counted as the document's top-level heading. Pages can now
carry both the front matter title MkDocs uses for navigation and the body
heading that renders on github.com.
An empty pattern is used rather than disabling MD025, so the rule still
reports a genuinely duplicated top-level heading. Converges with the same
setting in MSXOrg/docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown

No Significant Changes Detected

This PR does not contain changes to files that would trigger a new release:

PatternDescription
^src/Matches files where path matches this pattern
^README\.md$Matches files where path matches this pattern

Build, test, and publish stages will be skipped for this PR.

If you believe this is incorrect, please verify that your changes are in the correct locations.

@github-actions

Copy link
Copy Markdown

Super-linter summary

LanguageValidation result
CHECKOVPass ✅
GITHUB_ACTIONSPass ✅
GITLEAKSPass ✅
GIT_MERGE_CONFLICT_MARKERSPass ✅
MARKDOWNPass ✅
NATURAL_LANGUAGEPass ✅
POWERSHELLPass ✅
PRE_COMMITPass ✅
SPELL_CODESPELLPass ✅
TRIVYPass ✅
YAMLPass ✅

All files and directories linted successfully

For more information, see the GitHub Actions workflow run

Powered by Super-linter

@MariusStorhaug
Marius Storhaug (MariusStorhaug) marked this pull request as ready for review August 9, 2026 09:34
@MariusStorhaug
Marius Storhaug (MariusStorhaug) merged commit 4f525ab into mainAug 9, 2026
42 of 43 checks passed
@MariusStorhaug
Marius Storhaug (MariusStorhaug) deleted the maintenance-38-markdown-lint-md025 branch August 9, 2026 09:34
Sign up for freeto 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.

Allow a body heading alongside the front matter title in the markdown linter config

1 participant

@MariusStorhaug