Are you sure you want to delete this access key?
The /content
directory is where all the site's (English) Markdown content lives!
See the markup reference guide for more information about supported Markdown features.
See the contributing docs for general information about working with the docs.
YAML Frontmatter is an authoring convention popularized by Jekyll that provides a way to add metadata to pages. It is a block of key-value content that lives at the top of every Markdown file.
The following frontmatter values have special meanings and requirements for this site.
There's also a schema that's used by the test suite to validate every page's frontmatter.
See lib/frontmatter.js
.
versions
Object
. Allowable keys map to product names and can be found in the versions
object in lib/frontmatter.js
.*
is used to denote all releases for the version.Example that applies to GitHub.com and recent versions of GitHub Enterprise Server:
title: About your personal dashboard
versions:
free-pro-team: '*'
enterprise-server: '>=2.20'
Example that applies to all supported versions of GitHub Enterprise Server: (but not GitHub.com):
title: Downloading your license
versions:
enterprise-server: '*'
You can also version a page for a range of releases. This would version the page for GitHub Enterprise Server 2.22 and 3.0 only:
versions:
free-pro-team: '*'
enterprise-server: '>=2.22 <3.1'
redirect_from
Array
Example:
title: Getting started with GitHub Desktop
redirect_from:
- /articles/first-launch/
- /articles/error-github-enterprise-version-is-too-old/
- /articles/getting-started-with-github-for-windows/
See contributing/redirects
for more info.
title
<title>
tag and an h1
element at the top of the page.String
<title>
will still be set, albeit with a generic value like GitHub.com
or GitHub Enterprise
.shortTitle
String
title
will be used.Example:
title: Contributing to projects with GitHub Desktop
shortTitle: Contributing to projects
intro
title
.String
permissions
intro
.String
product
intro
and permissions
statement.String
layout
String
that matches the name of the layout file, without an extension.
For a layout named layouts/article.html
, the value would be article
.layouts/default.html
is used.children
Array
. Default is false
.index.md
pages.featuredLinks
Object
.The list of popular links are the links displayed on the landing page under the title "Popular." Alternately, you can customize the title "Popular" by setting the featuredLinks.popularHeading
property to a new string.
Example:
featuredLinks:
gettingStarted:
- /path/to/page
guides:
- /guides/example
popular:
- /path/to/popular/article1
- /path/to/popular/article2
popularHeading: An alternate heading to Popular
showMiniToc
Boolean
. Default is true
on articles, and false
on map topics and index.md
pages.miniTocMaxHeadingLevel
Number
. Default is 2
. Minimum is 2
. Maximum is 3
.allowTitleToDifferFromFilename
content/rest/reference/orgs.md
has a title of Organizations
instead of Orgs
. Pages with this frontmatter set to true
will not be flagged in tests or updated by script/reconcile-ids-with-filenames.js
.Boolean
. Default is false
.changelog
layouts/product-landing.html
). The one exception is Education, which pulls from https://github.blog/category/community/education.Object
, properties:
label
-- must be present and corresponds to the labels used in the GitHub Changelogprefix
-- optional string that starts each changelog title that should be omitted in the docs feed. For example, with the prefix GitHub Actions:
specified, changelog titles like GitHub Actions: Some Title Here
will render as Some Title Here
in the docs feed).defaultPlatform
String
, one of: mac
, windows
, linux
.Example:
defaultPlatform: linux
defaultTool
String
, one of: webui
, cli
, desktop
, curl
.defaultTool: cli
learningTracks
String
. This should reference learning tracks' names defined in data/learning-tracks/*.yml
.*Note: the featured track is set by a specific property in the learning tracks YAML. See that README for details.
includeGuides
type
and topics
. Only applicable when used with layout: product-sublanding
.Array
Example:
includeGuides:
- /actions/guides/about-continuous-integration
- /actions/guides/setting-up-continuous-integration-using-workflow-templates
- /actions/guides/building-and-testing-nodejs
- /actions/guides/building-and-testing-powershell
type
String
, one of the overview
, quick_start
, tutorial
, how_to
, reference
.topics
topics
property that is used to filter search results by topics. For more information, see the Search contributing guide. Refer to the content models for more details around adding topics. A full list of existing topics is located in the allowed topics file. If topics in article frontmatter and the allow-topics list become out of sync, the topics CI test will fail.String
scontributor
Object
. Properties are name
and URL
.Example:
contributor:
name: ACME, inc.
URL: https://acme.example.com/
If you see two single quotes in a row (''
) in YML frontmatter where you might expect to see one ('
), this is the YML-preferred way to escape a single quote. From the YAML spec:
In single quoted leaves, a single quote character needs to be escaped. This is done by repeating the character.
As an alternative, you can change the single quotes surrounding the frontmatter field to double quotes and leave interior single quotes unescaped.
Every article on the help site displays an autogenerated "In this article" section (aka mini TOC) at the top of the page that includes links to all H2
s in the article by default.
miniTocMaxHeadingLevel
frontmatter to specify the maximum heading level. For example: miniTocMaxHeadingLevel: 3
showMiniToc: false
Mini TOCs do not appear on product landing pages, category landing pages, or map topic pages.
Make sure not to add hardcoded "In this article" sections in the Markdown source or else the page will display duplicate mini TOCs.
A content file can have two types of versioning:
versions
frontmatter (required)
data
and include
files.As of early 2021, the free-pro-team@latest
version is only supported in content files (in both frontmatter and Liquid versioning) and throughout the docs site backend. It is not user facing. A helper function called lib/remove-fpt-from-path.js
removes the version from URLs. Users now select GitHub.com
in the Article Versions dropdown instead of Free, Pro, Team
.
The convenience function allows us to continue supporting a consistent versioning structure under-the-hood while not displaying plan information to users that may be potentially confusing.
When adding a new article, make sure the filename is a kebab-cased version of the title you use in the article's title
frontmatter. This can get tricky when a title has punctuation (such as "GitHub's Billing Plans"). A test will flag any discrepancies between title and filename. To override this requirement for a given article, you can add allowTitleToDifferFromFilename
frontmatter.
When using Liquid conditionals in lists or tables, you can use whitespace control characters to prevent the addition of newlines that would break the list or table rendering.
Just add a hyphen on either the left, right, or both sides to indicate that there should be no newline on that side. For example, this statement removes a newline on the left side:
{%- if currentVersion == 'free-pro-team@latest' %}
Local links must start with a product ID (like /actions
or /admin
), and image paths must start with /assets
. The links to Markdown pages undergo some transformations on the server side to match the current page's language and version. The handling for these transformations lives in lib/render-content/plugins/rewrite-local-links
.
For example, if you include the following link in a content file:
/github/writing-on-github/creating-a-saved-reply
When viewed on GitHub.com docs, the link gets rendered with the language code:
/en/github/writing-on-github/creating-a-saved-reply
and when viewed on GitHub Enterprise Server docs, the version is included as well:
/en/enterprise-server@2.20/github/writing-on-github/creating-a-saved-reply
There are transformations for image paths in GitHub Enterprise Server (versions 2.20-3.0) only. Once those versions are deprecation, there will no longer be any transformations for image paths. For more information, see /assets/images/enterprise/legacy-format/README.md.
Sometimes you want to link to a Dotcom-only article in Enterprise content and you don't want the link to be Enterprise-ified. To prevent the transformation, write the link using HTML and add a class of dotcom-only
. For example:
<a href="/github/site-policy/github-terms-of-service" class="dotcom-only">GitHub's Terms of Service</a>
Sometimes the canonical home of content moves outside the docs site. None of the links included in lib/redirects/external-sites.json
get rewritten. See contributing/redirects.md
for more info about this type of redirect.
Index pages are the Table of Contents files for the docs site. Every product, category, and map topic subdirectory has an index.md
that serves as the landing page. Each index.md
must contain a children
frontmatter property with a list of relative links to the child pages of the product, category, or map topic.
Important note: The site only knows about paths included in children
frontmatter. If a directory or article exists but is not included in children
, its path will 404.
To create a sublanding page (e.g. Actions' Guide page), create or modify an existing markdown file with these specific frontmatter values:
layout: product-sublanding
learningTracks
includeGuides
.If using learning tracks, they need to be defined in data/learning-tracks/*.yml
.
If using includeGuides
, make sure each of the articles in this list has topics
and type
in its frontmatter.
Press p or to see the previous file or, n or to see the next file
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?