Skip to main content
GitHub Docs extends the standard Liquid templating language with a set of custom tags. These tags are processed server-side before Markdown rendering and power versioning, reusable content, icon rendering, and UI interactions like tool and platform switchers.

{% data %} — variables and reusables

The {% data %} tag inserts content from files in the data/ directory. It is the primary mechanism for both variable substitution and reusable content inclusion.
See Reusables and variables for the full reference.

{% ifversion %} — version conditionals

The {% ifversion %} tag conditionally renders content based on the product version the reader is currently viewing. It supports {% elsif %}, {% else %}, and must be closed with {% endif %}.

Syntax

Version identifiers

Combining conditions

Real-world example

From content/account-and-profile/concepts/account-management.md:

{% octicon %} — inline icons

The {% octicon %} tag renders an Octicon inline within the text. This is used to reference the same icons that appear in the GitHub UI, so documentation can match what readers see on screen.

Syntax

Examples

Always provide either aria-label or both aria-hidden="true" and aria-label. Octicons used purely for decoration should use aria-hidden="true" so screen readers skip them.

Tool switcher tags

Tool tags display content selectively based on which tool the reader has selected. The reader can switch between tools using tabs that appear above the first tool-tagged section on the page.

Available tool tags

Example

From content/actions/how-tos/manage-workflow-runs/disable-and-enable-workflows.md:

Setting the default tool

By default the web UI tab is selected. To change the initial tool selection for a page, set defaultTool in the frontmatter:
The reader’s last explicit selection takes precedence over defaultTool for the rest of their session.

Platform switcher tags

Platform tags display content selectively based on the reader’s operating system. GitHub Docs detects the reader’s OS and selects the matching platform tab automatically.

Available platform tags

Example

From content/actions/how-tos/manage-runners/larger-runners/use-larger-runners.md:

Setting the default platform

If the reader’s OS is not the right default for a given page (for example, a page about GitHub Actions runners where Linux is almost always the relevant platform), override it with defaultPlatform:

Callout tags

Callouts render styled alert boxes in the published page. The GitHub Docs source uses Liquid-style callout tags; these map to styled blockquotes in the rendered output.
Modern GitHub Docs articles use the GFM alert syntax (> [!NOTE], > [!WARNING], > [!TIP]) as an alternative to Liquid callout tags. Both syntaxes are supported.

Note

Equivalent GFM syntax:

Warning

Equivalent GFM syntax:

Tip

Whitespace control

Liquid tags introduce newlines into the rendered output. Inside Markdown lists and tables, extra blank lines break the list or table structure. Use a hyphen immediately inside the tag delimiters to strip the adjacent whitespace.

Example: versioning a list item

Without {%-, a blank line appears before “Configure your enterprise hostname,” which breaks the ordered list numbering.

Example: versioning a table row

indented_data_reference

When a reusable needs to appear inside an ordered list, use indented_data_reference instead of {% data %} so the list indentation is preserved:
The spaces argument specifies how many spaces to prepend to each line of the reusable content.