docs/content
Laco Pápay 7d4541f86b
Fix storage for 2-core linux runners (#32506)
Co-authored-by: Alex Nguyen <150945400+nguyenalex836@users.noreply.github.com>
2024-04-15 16:30:32 +00:00
..
account-and-profile Delete infrequently used variables (#50090) 2024-04-11 15:23:07 +00:00
actions Fix storage for 2-core linux runners (#32506) 2024-04-15 16:30:32 +00:00
admin Enterprise bug fixes for the week of April 8, 2024 (#50125) 2024-04-15 14:07:55 +00:00
apps GitHub Apps have different public/private options (#49889) 2024-03-28 23:47:15 +00:00
authentication Remove `signout_link` and `signin_link` variables (#50093) 2024-04-11 14:55:24 +00:00
billing add ghe-license refactor docs for 3.13 (#49837) 2024-04-08 08:48:04 +00:00
code-security Include information about dependabot commit signing (#50138) 2024-04-15 14:53:41 +00:00
codespaces Codespaces: tiny change for isolated networking (#49912) 2024-04-03 11:05:58 +00:00
communities docs: made updates about security files and improving sentences (#32411) 2024-04-08 15:21:48 +00:00
contributing Update contributing doc to match style guide (#50139) 2024-04-15 16:18:30 +00:00
copilot Quote $GH_COPILOT_PROFILE (#32460) 2024-04-11 08:18:10 +00:00
desktop Remove all `ifversion` that has all versions (4) (#49476) 2024-03-01 18:28:53 +00:00
discussions Discussions that are announcements can't be transferred (#31540) 2024-02-09 15:27:06 +00:00
education Update leave-feedback-with-pull-requests.md (#31419) 2024-03-27 17:47:04 +00:00
get-started Clarify that included 50k actions minutes does not apply to larger runners (#50029) 2024-04-08 06:48:19 +00:00
github-cli Remove github-ae from lib/all-versions.js (#49235) 2024-02-20 12:54:34 +00:00
graphql Added GraphQL explorer autocompletion details (#49614) 2024-03-11 21:04:53 +00:00
issues Fix filter iteration by range example (#32470) 2024-04-11 13:56:02 +00:00
migrations [Improvement]: Improve sensitive information warning to improve new user experience (#49919) 2024-04-03 11:37:46 +00:00
organizations Enterprise bug fixes for the week of April 8, 2024 (#50125) 2024-04-15 14:07:55 +00:00
packages [Improvement]: Improve docs for repository access to private packages (#49727) 2024-04-10 22:14:54 +00:00
pages Windows users can use the Resolve-DnsName command. (#32449) 2024-04-11 08:51:35 +00:00
pull-requests In pull requests article about why diffs aren't displayed, link directly to most relevant diff limits article (#49949) 2024-04-02 07:07:55 +00:00
repositories The "Renaming a branch" setting was changed. (#32504) 2024-04-15 16:07:58 +00:00
rest #31660 Delete mentions of X-GitHub-OTP from the docs (#32412) 2024-04-08 19:35:45 +00:00
search Remove github-ae from lib/all-versions.js (#49235) 2024-02-20 12:54:34 +00:00
search-github Update about-github-code-search.md (#32379) 2024-04-04 18:13:20 +00:00
site-policy fix typo (#32473) 2024-04-11 19:07:43 +00:00
sponsors Documentation for "Bulk Sponsorships for Recurring - [GA]" (#49293) 2024-03-06 19:50:21 +00:00
support Added extra sentence regarding resource visibility (#50132) 2024-04-15 12:09:13 +00:00
video-transcripts Remove github-ae from lib/all-versions.js (#49235) 2024-02-20 12:54:34 +00:00
webhooks Switch article order (#49968) 2024-04-02 15:56:48 +00:00
README.md Deprecate `contributing` directory (#45581) 2023-11-13 17:55:50 +00:00
index.md Remove content, data, and update fixtures (#49333) 2024-02-23 20:02:15 +00:00

README.md

Content

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.

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.

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

  • Purpose: Indicates the versions to which a page applies. See Versioning for more info.
  • Type: Object. Allowable keys map to product names and can be found in the versions object in lib/frontmatter.js.
  • This frontmatter value is currently required for all pages.
  • The * 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:
  fpt: '*'
  ghes: '>=2.20'

Example that applies to all supported versions of GitHub Enterprise Server: (but not GitHub.com):

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

You can also version a page for a range of releases. This would version the page for GitHub.com, and GitHub Enterprise Server versions 2.22 and 3.0 only:

versions:
  fpt: '*'
  ghes: '>=2.22 <3.1'

redirect_from

  • Purpose: List URLs that should redirect to this page.
  • Type: Array
  • Optional

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

  • Purpose: Set a human-friendly title for use in the rendered page's <title> tag and an h1 element at the top of the page.
  • Type: String
  • Optional. If omitted, the page <title> will still be set, albeit with a generic value like GitHub.com or GitHub Enterprise.

shortTitle

  • Purpose: An abbreviated variant of the page title for use in breadcrumbs and navigation elements.
  • Type: String
  • Optional. If omitted, title will be used.
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

  • Purpose: Sets the intro for the page. This string will render after the title.
  • Type: String
  • Optional.

permissions

  • Purpose: Sets the permission statement for the article. This string will render after the intro.
  • Type: String
  • Optional.

product

  • Purpose: Sets the product callout for the article. This string will render after the intro and permissions statement.
  • Type: String
  • Optional.

layout

  • Purpose: Render the proper page layout.
  • Type: String that matches the name of the layout. For a layout named components/landing, the value would be product-landing.
  • Optional. If omitted, DefaultLayout is used.

children

  • Purpose: Lists the relative links that belong to the product/category/map topic. See Index pages for more info.
  • Type: Array. Default is false.
  • Required on index.md pages.

childGroups

  • Purpose: Renders children into groups on the homepage. See Homepage for more info.
  • Type: Array. Default is false.
  • Require on the homepage index.md.
  • Purpose: Renders the linked articles' titles and intros on product landing pages and the homepage.
  • Type: Object.
  • Optional.

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

  • Purpose: Indicates whether an article should show a mini table of contents (TOC) above the rest of the content. See Autogenerated mini TOCs for more info.
  • Type: Boolean. Default is true on articles, and false on map topics and index.md pages.
  • Optional.

allowTitleToDifferFromFilename

  • Purpose: Indicates whether a page is allowed to have a title that differs from its filename. Pages with this frontmatter set to true will not be flagged in tests or updated by src/content-render/scripts/reconcile-filenames-with-ids.js. Use this value if a file's title frontmatter includes Liquid or punctuation that cannot be part of the filename. For example, the article "About Enterprise Managed Users" uses a Liquid reusable in its title, 'About {% data variables.product.prodname_emus %}', which cannot be in the filename, about-enterprise-managed-users.md, so the allowTitleToDifferFromFilename frontmatter is set to true.
  • Type: Boolean. Default is false.
  • Optional.

changelog

  • Purpose: Render a list of items pulled from GitHub Changelog on product landing pages (ex: components/landing). The one exception is Education, which pulls from https://github.blog/category/community/education.
  • Type: Object, properties:
    • label -- must be present and corresponds to the labels used in the GitHub Changelog
    • prefix -- 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).
  • Optional.

defaultPlatform

  • Purpose: Override the initial platform selection for a page. If this frontmatter is omitted, then the platform-specific content matching the reader's operating system is shown by default. This behavior can be changed for individual pages, for which a manual selection is more reasonable. For example, most GitHub Actions runners use Linux and their operating system is independent of the reader's operating system.
  • Type: String, one of: mac, windows, linux.
  • Optional.

Example:

defaultPlatform: linux

defaultTool

  • Purpose: Override the initial tool selection for a page, where the tool refers to the application the reader is using to work with GitHub (such as GitHub.com's web UI, the GitHub CLI, or GitHub Desktop) or the GitHub APIs. For more information about the tool selector, see Markup reference for GitHub Docs. If this frontmatter is omitted, then the tool-specific content matching the GitHub web UI is shown by default. If a user has indicated a tool preference (by clicking on a tool tab), then the user's preference will be applied instead of the default value.
  • Type: String, one of: webui, cli, desktop, curl, codespaces, vscode, importer_cli, graphql, powershell, bash, javascript.
  • Optional.
defaultTool: cli

learningTracks

  • Purpose: Render a list of learning tracks on a product's sub-landing page.
  • type: String. This should reference learning tracks' names defined in data/learning-tracks/*.yml.
  • Optional

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

includeGuides

  • Purpose: Render a list of articles, filterable by type and topics. Only applicable when used with layout: product-guides.
  • Type: Array
  • Optional.

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

  • Purpose: Indicate the type of article.
  • Type: String, one of the overview, quick_start, tutorial, how_to, reference.
  • Optional.

topics

  • Purpose: Indicate the topics covered by the article. The topics are used to filter guides on some landing pages. For example, the guides at the bottom of this page can be filtered by topics, and the topics are listed under the guide intro. Refer to the content models for more details about 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.
  • Type: Array of Strings
  • Optional: Topics are preferred for each article, but, there may be cases where existing articles don't yet have topics, or adding a topic to a new article may not add value.

communityRedirect

  • Purpose: Set a custom link and link name for Ask the GitHub community link in the footer.
  • Type: Object. Properties are name and href.
  • Optional.

effectiveDate

  • For GitHub staff only: Set an effective date for Terms of Service articles so that engineering teams can automatically re-prompt users to confirm the terms
  • Type: string YEAR-MONTH-DAY e.g. 2021-10-04 is October 4th, 2021
  • Optional.

Escaping single quotes

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.

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.

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.

Versioning

A content file can have two types of versioning:

  • versions frontmatter (required)
  • Liquid statements in content (optional)
    • Conditionally render content depending on the current version being viewed. See "Versioning documentation" for more info. Note Liquid conditionals can also appear in data and include files.

Note: As of early 2021, the free-pro-team@latest version is not included URLs. A helper function called lib/remove-fpt-from-path.js removes the version from URLs.

Filenames

When adding a new article, the filename is a kebab-cased version of the article's title frontmatter. For example, the article "About GitHub CLI" has a title frontmatter of About GitHub CLI and a filename of about-github-cli.md.

Directory names for categories and map topics can match the title or shortTitle frontmatter.

For a title that contains punctuation (such as "GitHub's Billing Plans"), you can omit the punctuation in the filename (githubs-billing-plans.md). For a title that uses a Liquid variable (such as About {% data variables.product.prodname_emus %}), you can use the words that the Liquid renders as in the filename (about-enterprise-managed-users.md). A test will flag any discrepancies between title and filename. To override the requirement that titles and filenames match for a given article, you can add allowTitleToDifferFromFilename in the frontmatter.

Whitespace control

When using Liquid conditionals in lists or tables, you can use whitespace control characters to prevent the addition of newlines and other whitespace that would break the list or table rendering.

You can add a hyphen (-) on either the left, right, or both sides to indicate that there should be no newline or other whitespace on that side.

{%- ifversion fpt %}

For example, to version a table row, instead of adding liquid versioning for the row starting at the end of the previous row, like this:

Column A | Column B | Column C
---------|----------|---------
This row is for all versions | B1 | C1{% ifversion ghes %}
This row is for GHES only | B2 | C2{% endif %}
This row is for all versions | B3 | C3

You can include the liquid versioning on its own line and use whitespace control to strip the newline to the left of the liquid tag. This makes reading the source much easier, without breaking the rendering of the table:

Column A | Column B | Column C
---------|----------|---------
This row is for all versions | B1 | C1
{%- ifversion ghes %}
This row is for GHES only | B2 | C2
{%- endif %}
This row is for all versions | B3 | C3

Links to docs in the docs-internal repository must start with a product ID (like /actions or /admin) and contain the entire filepath, but not the file extension. For example, /actions/creating-actions/about-custom-actions.

Image paths must start with /assets and contain the entire filepath including the file extension. For example, /assets/images/help/settings/settings-account-delete.png.

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

If you create an internal link, you can use the AUTOTITLE keyword to generate an article's title in the rendered link. See the markup reference for details.

Linking to the current article in a different version of the docs

Sometimes you may want to link from an article to the same article in a different product version. For example:

  • You mention some functionality that is not available for free, pro, or team plans and you want to link to the GitHub Enterprise Cloud version of the same page.
  • The GitHub Enterprise Server version of an article describes a feature that shipped with that version, but site administrators can upgrade to the latest version of the feature that's in use on GitHub Enterprise Cloud.

You can link directly to a different version of the page using the currentArticle property. This means that the link will continue to work directly even if the article URL changes.

{% ifversion fpt %}For more information, see the [{% data variables.product.prodname_ghe_cloud %} documentation](/enterprise-cloud@latest/{{ currentArticle }}).{% endif %}

Preventing transformations

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, you should include the preferred version in the path.

"[GitHub's Terms of Service](/free-pro-team@latest/github/site-policy/github-terms-of-service)"

Sometimes the canonical home of content moves outside the docs site. None of the links included in src/redirects/lib/external-sites.json get rewritten. See contributing/redirects.md for more info about this type of redirect.

Our docs contain links that use legacy filepaths such as /article/article-name or /github/article-name. Our docs also contain links that refer to articles by past names. Both of these link types function properly because of redirects, but they are bugs.

When you add a link to an article, use the current filepath and article name.

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 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.

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. Actions' Guide page), create or modify an existing markdown file with these specific frontmatter values:

  1. Use the product guides page template by referencing layout: product-guides.
  2. (optional) Include the learning tracks in learningTracks.
  3. (optional) Define which articles to include with 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.