Skip to main content
GitHub Docs content files are written in GitHub Flavored Markdown (GFM) with Liquid templating layered on top. Every .md file in the content/ directory can use the full GFM feature set plus a set of custom Liquid tags that handle versioning, reusable content, and UI interactions.

Frontmatter

Every content file begins with a YAML frontmatter block delimited by ---. The frontmatter provides metadata that controls how the page is rendered, which versions it appears in, and how it appears in navigation.

Required and common fields

The versions frontmatter field is required on every page. Omitting it will cause test failures. See Versioning for the full syntax.

Escaping single quotes in frontmatter

YAML requires escaping single quotes inside single-quoted strings by doubling them:

The allowTitleToDifferFromFilename field

If a page title contains Liquid variables or punctuation that cannot appear in a filename, set this flag to true to suppress test failures:

GitHub Flavored Markdown

GitHub Docs supports the full GFM spec, including:
  • Fenced code blocks with language identifiers
  • Tables
  • Task lists
  • Strikethrough
  • Autolinks
  • Footnotes
Code blocks should always include a language identifier:

Liquid templating

Liquid is a templating language processed server-side before the Markdown is rendered. GitHub Docs uses liquidjs with several custom tags.

Available tags

Autogenerated mini TOC

Every article page automatically generates an “In this article” section above the content body. This mini table of contents links to every H2 heading in the file.
Only H2 headers appear in the mini TOC. H3 and H4 headings are not included. Do not manually add an “In this article” section — it creates a duplicate.
Mini TOCs do not appear on product landing pages, category landing pages, or map topic pages. You can suppress the mini TOC on a specific article by setting showMiniToc: false in frontmatter. Internal links must start with a product ID and use the full filepath without the file extension:
The server rewrites these links at render time to include the current language code and version prefix. For example, when viewed in a GitHub Enterprise Server context, /actions/quickstart becomes /en/enterprise-server@3.12/actions/quickstart.

AUTOTITLE

To avoid duplicating article titles in link text and to ensure titles stay current as articles are renamed, use the AUTOTITLE keyword as the link text:
The rendered link text is automatically filled in with the target article’s current title frontmatter value.

Linking to the current article in a different version

Use the currentArticle property to create a cross-version link that stays valid even if the article URL changes:

Preventing version transformations

By default, internal links are rewritten to match the current version context. To pin a link to a specific version (for example, linking to a GitHub.com-only policy page from an Enterprise article), include the version in the path:

Image paths

Images are stored under /assets/ and must be referenced using their full path including the file extension:
Always include descriptive alt text. Alt text should describe what is shown in the image, not just repeat the surrounding prose.

Whitespace control

When Liquid tags appear inside Markdown lists or tables, the extra newlines they introduce can break the rendered output. Use the hyphen (-) modifier on either or both sides of a Liquid tag to strip the adjacent whitespace:

Example: versioning a table row

Without whitespace control, inserting a Liquid conditional mid-table breaks the table:
With whitespace control on its own line, the source remains readable and the table renders correctly:
The {%- strips the newline to the left of the tag, preventing an empty line from appearing between table rows.

Filenames

Article filenames are kebab-case versions of the article title frontmatter. For example: If a title contains Liquid (such as About {% data variables.product.prodname_emus %}), the filename uses the rendered text (about-enterprise-managed-users.md) and the page requires allowTitleToDifferFromFilename: true.