Rule 2
Important
The name of a folder that contains a README.md must match the title of that README.md. Code: MDU002 DirectoryTitleMatch.
Why
A README.md is the page readers open when they enter a folder. When the folder name matches its title, readers know what the section covers while they browse the repository, and the navigation of the rendered site shows the same name.
Example
# Notes
These are my notes.
| Folder | Title | Result |
|---|---|---|
notes/ |
# Notes |
Matches |
Keyboard-Keys/ |
# Keyboard Keys |
Matches; case, spaces, hyphens, and underscores are ignored |
Rule2/ |
# Rule 2: Folder names |
Matches; only the text before the first colon counts |
docs/ |
# Overview |
Rename the folder or the title |
Set navigation.title when a section should show a different label in the navigation.