Skip to main content
The /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

Every directory that has child pages needs an index.md. That file becomes the landing page for the directory URL and declares the navigation via its children frontmatter.
Directory names for categories and map topics can match either the title or shortTitle frontmatter of the index.md inside.

Filename conventions

Filenames are the kebab-case equivalent of the article’s title frontmatter.

Handling punctuation and Liquid variables

When a title contains punctuation, omit it from the filename:
When a title contains a Liquid variable, use the words the variable renders as:
A test in CI validates that filenames and titles match. If the title legitimately cannot match the filename (for example, because it contains a Liquid variable), set allowTitleToDifferFromFilename: true in frontmatter to suppress the check.

The index.md pattern

Every product, category, and map topic directory must contain an index.md. This file:
  • Renders as the landing page for that URL segment.
  • Declares every child page through the children frontmatter array.
  • Is the only mechanism through which the site discovers nested pages.
If a .md file exists on disk but is not listed in a parent index.md children array, its URL returns 404. The site build does not crawl the filesystem — it walks the children graph.
A minimal index.md:

How content maps to URLs

The path from content/ to the file maps directly to the URL, with these rules:
  • The /content prefix is stripped.
  • File extensions (.md) are dropped.
  • index.md files become the bare directory URL.
  • On GitHub.com (fpt), the version segment (free-pro-team@latest) is removed from URLs automatically.
On GitHub Enterprise Server, a version segment is inserted:

Adding a new article

1

Create the Markdown file

Create a .md file in the appropriate directory. Name it as the kebab-case version of the article title.
2

Write the frontmatter

Add at minimum title and versions. Add contentType, intro, and any other relevant fields.
3

Add the article to the parent index.md

Open the index.md in the same directory and add the new filename (without extension) to the children array.
Links to other docs pages follow a strict format enforced by the build and validated in CI. 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.
The site’s link rewriter (src/content-render/unified/rewrite-local-links.ts) adds the correct language code and version segment at render time. For example:
Use the AUTOTITLE 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 a fpt article to the equivalent ghec article:
The 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:
With whitespace control, the Liquid tag sits on its own line without introducing extra newlines:
The {%- 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.