data/ and inserted into content files using the {% data %} Liquid tag.
How they differ
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
Product feature variables
Product feature variables
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
1
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.2
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 %}.3
Reference it in content
Use the
{% data %} tag with the full dotted path: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
1
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
2
Create the Markdown file
Create a new
.md file with a descriptive kebab-case name:3
Write the content
Write valid Markdown. You can use Liquid variables and conditionals inside reusables:
4
Reference it in content
Add the
{% data %} tag wherever the reusable should appear: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