/content directory is the single source of truth for all English Markdown content on the GitHub Docs site. Its directory structure maps directly to the URL structure of the published site.
Directory layout
index.md. That file becomes the landing page for the directory URL and declares the navigation via its children frontmatter.
Filename conventions
Filenames are the kebab-case equivalent of the article’stitle frontmatter.
| Title frontmatter | Filename |
|---|---|
About GitHub CLI | about-github-cli.md |
Getting started with GitHub Desktop | getting-started-with-github-desktop.md |
Workflow syntax for GitHub Actions | workflow-syntax-for-github-actions.md |
Handling punctuation and Liquid variables
When a title contains punctuation, omit it from the filename:allowTitleToDifferFromFilename: true in frontmatter to suppress the check.
The index.md pattern
Every product, category, and map topic directory must contain anindex.md. This file:
- Renders as the landing page for that URL segment.
- Declares every child page through the
childrenfrontmatter array. - Is the only mechanism through which the site discovers nested pages.
index.md:
How content maps to URLs
The path fromcontent/ to the file maps directly to the URL, with these rules:
- The
/contentprefix is stripped. - File extensions (
.md) are dropped. index.mdfiles become the bare directory URL.- On GitHub.com (
fpt), the version segment (free-pro-team@latest) is removed from URLs automatically.
| File path | Published URL |
|---|---|
content/actions/index.md | /en/actions |
content/actions/quickstart.md | /en/actions/quickstart |
content/actions/using-workflows/index.md | /en/actions/using-workflows |
content/actions/using-workflows/workflow-syntax-for-github-actions.md | /en/actions/using-workflows/workflow-syntax-for-github-actions |
Adding a new article
Create the Markdown file
Create a
.md file in the appropriate directory. Name it as the kebab-case version of the article title.Write the frontmatter
Add at minimum
title and versions. Add contentType, intro, and any other relevant fields.Link format requirements
Links to other docs pages follow a strict format enforced by the build and validated in CI.Internal links
Internal links must:- Start with the product ID (the first path segment under
/content, e.g./actions,/codespaces,/admin). - Include the full filepath to the target article.
- Omit the file extension.
src/content-render/unified/rewrite-local-links.ts) adds the correct language code and version segment at render time. For example:
AUTOTITLE for internal links
Use theAUTOTITLE keyword instead of typing out link text manually. The site substitutes the target article’s title frontmatter at render time, so link text stays accurate even if a title changes.
AUTOTITLE only works on internal links. Use normal link text for external URLs.Linking to the same article in a different version
To link from afpt article to the equivalent ghec article:
currentArticle variable resolves to the path of the current page, so the link remains correct if the article URL changes.
Preventing version transforms
By default, internal links are rewritten to match the current version. To link to a specific version regardless of context (for example, to pin a link to GitHub.com from an Enterprise article), include the version in the path:Image paths
Image paths must start with/assets and include the full path with extension:
Whitespace control in Liquid
When using Liquid conditionals inside Markdown lists or tables, extra blank lines break the rendering. Use the hyphen (-) whitespace control character to strip newlines adjacent to a Liquid tag.
Without whitespace control, a versioned table row causes a rendering break:
{%- strips the newline to the left of the tag; -%} strips it to the right. You can apply them to one or both sides as needed.