A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.github.com/en/contributing/writing-for-github-docs/using-yaml-frontmatter below:

Using YAML frontmatter - GitHub Docs

You can use YAML frontmatter to define versioning, add metadata, and control the layout for articles.

About YAML frontmatter

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 within GitHub Docs. For more information, see the YAML frontmatter documentation.

YAML frontmatter values

The following frontmatter values have special meanings and requirements for GitHub Docs. There's also a schema that's used by the test suite to validate every page's frontmatter. For more information, see lib/frontmatter.js.

versions

This frontmatter value is used by the docs site to generate "permalinks" for each version of an article. For more information, see Permalinks.

Example that applies to Free, Pro, & Team and GitHub Enterprise Server version 3.11 and later:

title: About your personal dashboard
versions:
  fpt: '*'
  ghes: '>=3.11'

Example that applies only to GitHub Enterprise Server:

title: Downloading your license
versions:
  ghes: '*'

You can also version a page for a range of releases. This would version the page for Free, Pro, & Team, and GitHub Enterprise Server versions 3.1 and 3.2 only:

versions:
  fpt: '*'
  ghes: '>=3.1 <3.3'
redirect_from

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

For more information, see Configuring redirects.

title shortTitle Article type Maximum character length articles 31 categories 27 map topics 30

Example:

title: Contributing to projects with GitHub Desktop
shortTitle: Contributing to projects
intro permissions product layout children childGroups featuredLinks

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
  startHere:
    - /guides/example
  popular:
    - /path/to/popular/article1
    - /path/to/popular/article2
  popularHeading: An alternate heading to Popular
showMiniToc allowTitleToDifferFromFilename changelog defaultPlatform

Example:

defaultPlatform: linux
defaultTool
defaultTool: cli
learningTracks

Note

The featured track is set by a specific property in the learning tracks YAML. See that README for details.

includeGuides

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 topics effectiveDate

Note

The effectiveDate frontmatter value is for use by GitHub staff only.

Escaping single quotes

If you see two single quotes in a row ('') in YAML frontmatter where you might expect to see one ('), this is the YAML-preferred way to escape a single quote.

As an alternative, you can change the single quotes surrounding the frontmatter field to double quotes and leave interior single quotes unescaped.

Autogenerated mini TOCs

Every article displays a mini table of contents (TOC), which is an autogenerated "In this article" section that includes links to all H2s in the article. Only H2 headers are included in the mini TOCs. If an article uses H3 or H4 headers to divide information in a way that only certain sections are relevant to a particular task, you can help people navigate to the content most relevant to them by using a sectional TOC.

You can use the showMiniToc frontmatter value, set to false, to prevent the mini TOC from showing up for an article.

Mini TOCs do not appear on product landing pages, category landing pages, or map topic pages.

Do not add hardcoded "In this article" sections in the Markdown source or else the page will display duplicate mini TOCs.

Filenames

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.

Index pages

Index pages are the table of contents files for the Docs site. Every product, category, and map topic subdirectory has an index.md file that provides an overview of the content and links to every child article. 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. Index pages require a versions frontmatter property, and the actual value will be computed at runtime based on the versions of children articles.

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 return a 404.

Homepage

The homepage is the main Table of Contents file for the docs site. The homepage must have a complete list of children, like every Index page but must also specify the childGroups frontmatter property that will be highlighted in the main content area.

childGroups is an array of mappings containing a name for the group, an optional icon for the group, and an array of children. The children in the array must be present in the children frontmatter property.

Creating new product guides pages

To create a product guides page (e.g. GitHub Actions Guide page), create or modify an existing markdown file with these specific frontmatter values:

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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4