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.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/github/docs/llms.txt
Use this file to discover all available pages before exploring further.
{% 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.
{% 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
| Identifier | Product |
|---|---|
fpt | GitHub.com (free, pro, team) |
ghes | GitHub Enterprise Server |
ghec | GitHub Enterprise Cloud |
Combining conditions
Real-world example
Fromcontent/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
| Tag | Tool |
|---|---|
{% webui %} / {% endwebui %} | GitHub.com web interface |
{% cli %} / {% endcli %} | GitHub CLI (gh) |
{% desktop %} / {% enddesktop %} | GitHub Desktop |
{% curl %} / {% endcurl %} | cURL (REST API calls) |
{% codespaces %} / {% endcodespaces %} | GitHub Codespaces |
{% vscode %} / {% endvscode %} | Visual Studio Code |
{% graphql %} / {% endgraphql %} | GraphQL API |
{% powershell %} / {% endpowershell %} | PowerShell |
{% bash %} / {% endbash %} | Bash |
{% javascript %} / {% endjavascript %} | JavaScript |
Example
Fromcontent/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, setdefaultTool in the frontmatter:
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
| Tag | Platform |
|---|---|
{% mac %} / {% endmac %} | macOS |
{% windows %} / {% endwindows %} | Windows |
{% linux %} / {% endlinux %} | Linux |
Example
Fromcontent/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 withdefaultPlatform:
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
Warning
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.| Syntax | Effect |
|---|---|
{%- tag %} | Strip whitespace before the tag. |
{% tag -%} | Strip whitespace after the tag. |
{%- tag -%} | Strip whitespace on both sides. |
Example: versioning a list item
{%-, 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:
spaces argument specifies how many spaces to prepend to each line of the reusable content.