data/ and inserted into content files using the {% data %} Liquid tag.
How they differ
| Reusables | Variables | |
|---|---|---|
| Location | data/reusables/<category>/<filename>.md | data/variables/<filename>.yml |
| Format | Markdown file (one reusable per file) | YAML file (multiple variables per file) |
| Content type | Paragraphs, steps, lists, tables | Short strings, product names, URLs |
| Reference syntax | {% data reusables.category.filename %} | {% data variables.file.key %} |
Variables
Variables are short strings stored in YAML files underdata/variables/. Each file groups related variables together. The path to a variable in the {% data %} tag matches the directory path and key within the YAML file.
Referencing variables
Given the file structure:Product name variables
The most commonly used variables are indata/variables/product.yml. Use these consistently instead of hardcoding product names — they allow for centralized updates and correct localization.
GitHub platform variables
GitHub platform variables
| Variable | Renders as | When to use |
|---|---|---|
variables.product.github | GitHub | Generic reference to the GitHub platform. |
variables.product.prodname_dotcom | GitHub | Deprecated alias for github. Prefer github. |
variables.product.prodname_dotcom_the_website | GitHub.com | When the .com domain specifically matters. |
variables.product.prodname_enterprise | GitHub Enterprise | Any GitHub Enterprise product. |
variables.product.prodname_ghe_server | GitHub Enterprise Server | GHES specifically. |
variables.product.prodname_ghe_cloud | GitHub Enterprise Cloud | GHEC specifically. |
Product feature variables
Product feature variables
| Variable | Renders as |
|---|---|
variables.product.prodname_actions | GitHub Actions |
variables.product.prodname_codespaces | Codespaces |
variables.product.prodname_github_codespaces | GitHub Codespaces |
variables.product.prodname_copilot | GitHub Copilot |
variables.product.prodname_cli | GitHub CLI |
variables.product.prodname_desktop | GitHub Desktop |
variables.product.prodname_pages | GitHub Pages |
variables.product.prodname_registry | GitHub Packages |
variables.product.prodname_GHAS | GitHub Advanced Security |
variables.product.prodname_dependabot | Dependabot |
variables.product.prodname_discussions | GitHub Discussions |
variables.product.prodname_sponsors | GitHub Sponsors |
Version-aware variables
Version-aware variables
Some variables use When referenced as
{% ifversion %} internally to return different strings depending on the current version context. For example:{% data variables.product.prodname_container_registry_namespace %}, this renders ghcr.io on GitHub.com and a hostname-relative URL on GitHub Enterprise Server.Creating a new variable
Choose or create a YAML file
Find the relevant file in
data/variables/ (for example, product.yml for product names, actions.yml for Actions-specific strings). Create a new file only if no existing file fits the category.Add the key-value pair
Add a descriptive key and its string value:For nested variables:Reference nested variables as
{% data foo.bar.nested.values.label %}.Reusables
Reusables are longer Markdown content blocks — paragraphs, steps, tables — that appear in multiple articles. Each reusable lives in its own.md file under data/reusables/.
Referencing reusables
Given the filedata/reusables/repositories/navigate-to-repo.md, reference it as:
.md extension).
Real examples
Common reusables used throughout the GitHub Docs source:Reusables in ordered lists
When a reusable appears as a step inside an ordered list, useindented_data_reference with a spaces argument to preserve list indentation:
spaces value is the number of spaces the reusable lines should be indented, matching the list item indentation level.
Creating a new reusable
Identify the right directory
Reusables are organized by task or product area. Look in
data/reusables/ for a directory that fits your content. For example:data/reusables/actions/for GitHub Actions stepsdata/reusables/repositories/for repository navigation stepsdata/reusables/organizations/for organization management steps
Write the content
Write valid Markdown. You can use Liquid variables and conditionals inside reusables:
When to use reusables vs. variables
Use a variable
- Product names and trademarked strings
- Short UI labels that appear inline in sentences
- URLs that may change across versions
- Strings fewer than one sentence long
Use a reusable
- Navigation steps repeated across multiple how-to articles
- Prerequisite paragraphs shared by related articles
- Permission statements used by multiple pages
- Any content block longer than one sentence