0a4f3e7dab
* New article title & reposition article * Update links * Remove "Deleting a container image" article * Reusable shuffle * Add GHES versioned article * more context * Revise main article * Reminder of permissions * Update some copy * Add "deleting a package" to TOC * Add versioning around links * Update restore package procedure * Update permissions statements * Fix GHES link * Apply suggestions from code review Co-authored-by: Martin Lopes <martin389@github.com> * Use "entire" language * GraphQL nuance * New intro + actions * Fix GHES link * Package deletion 2.0 follow up (#17855) * Remove GHES 3.1 versioning * 3.0 or less * Revert "Remove GHES 3.1 versioning" This reverts commit 9bbc0bd57c1c7ba23097f3f4b9a830c13941402c. * Revert "3.0 or less" This reverts commit dfd2f48e4a4da62c2594fbeaeb12eacda5afc6d4. * Revert "Revert "Remove GHES 3.1 versioning"" This reverts commit ef90065eb2883041b15bd2d50f97e4f07cf04768. * Ditch unnecessary package namespace references and rework permissions framing * Add placeholder note so PR tests will pass * Add versioning around package deletion mentions outside of main deletion articles * Add placeholder around link so it will go live * Add `audit_log` entries * Apply suggestions from code review Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com> * Apply Shati's suggestion * Remove duplicate line Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com> * Package deletion 2.0 last updates (#17880) * Update versioning and placeholder note * syntax improvement * Note the 25 downloads caveat * Add more headings * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Sarah Edwards <skedwards88@github.com> * Apply suggestions from code review * Apply suggestions from code review * Packages REST API page (#17808) * Add draft of packages REST page * Add packages in TOC * Rewrite Packages API introductory info * Fix space * Rewrite conceptual API intro content * Revise this line * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Mark Phelps <markphelps@github.com> * Add rewrite * Add de dereferenced files * Add the decorated files * ALL of the decorated files * Revert "ALL of the decorated files" This reverts commit 38f13dcd75078f2eacb53dfd0b31c79737966656. * Revert "Add the decorated files" This reverts commit b0c8a2096c8b19e62404585f97298ab42822d3e5. * Revert "Add de dereferenced files" This reverts commit abd377c8eb804e9c69dffa9b0c01ec64fb500727. * Commit the lib/rest/static files to preview changes on staging * Revert "Commit the lib/rest/static files to preview changes on staging" This reverts commit acb121ae9d8bd2e23b00ebb14848e7b83aeddf5b. Co-authored-by: Mark Phelps <markphelps@github.com> * Commit static files to preview endpoints on staging * Update references to API support * remove static rest api files * ditch "as a user" for now * Rearrange based on feedback * Last tidbits * Update OpenAPI Descriptions (#17893) * Update OpenAPI Descriptions * Add decorated OpenAPI schema files * link fix Co-authored-by: Martin Lopes <martin389@github.com> Co-authored-by: Shati Patel <42641846+shati-patel@users.noreply.github.com> Co-authored-by: Sarah Edwards <skedwards88@github.com> Co-authored-by: Mark Phelps <markphelps@github.com> Co-authored-by: github-openapi-bot <69533958+github-openapi-bot@users.noreply.github.com> |
||
---|---|---|
.. | ||
actions | ||
admin | ||
desktop | ||
developers | ||
discussions | ||
education | ||
github | ||
graphql | ||
insights | ||
packages | ||
rest | ||
README.md | ||
index.md |
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
- Autogenerated mini TOCs
- Versioning
- Filenames
- Whitespace control
- Links and image paths
- Creating new sublanding pages
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 theversions
object inlib/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:
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
- 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 anh1
element at the top of the page. - Type:
String
- Optional. If omitted, the page
<title>
will still be set, albeit with a generic value likeGitHub.com
orGitHub Enterprise
.
shortTitle
- Purpose: An abbreviated variant of the page title for use in breadcrumbs.
- Type:
String
- Optional. If omitted,
title
will be used.
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
andpermissions
statement. - Type:
String
- Optional.
layout
- Purpose: Wrap the page in a custom HTML layout.
- Type:
String
that matches the name of the layout file, without an extension. For a layout namedlayouts/article.html
, the value would bearticle
. - Optional. If omitted,
layouts/default.html
is used.
mapTopic
- Purpose: Indicates whether a page is a map topic. See Map Topic Pages for more info.
- Type:
Boolean
. Default isfalse
. - Optional.
featuredLinks
- Purpose: Renders the linked articles' titles and intros on product landing pages and the homepage.
- Type:
Object
. - Optional.
Example:
featuredLinks:
gettingStarted:
- /path/to/page
guides:
- /guides/example
showMiniToc
- Purpose: Indicates whether an article should show a mini TOC above the rest of the content. See Autogenerated mini TOCs for more info.
- Type:
Boolean
. Default istrue
on articles, andfalse
on map topics andindex.md
pages. - Optional.
miniTocMaxHeadingLevel
- Purpose: Indicates the maximum heading level to include in an article's mini TOC. See Autogenerated mini TOCs for more info.
- Type:
Number
. Default is3
. Minimum is2
. Maximum is4
. - Optional.
allowTitleToDifferFromFilename
- Purpose: Indicates whether a page is allowed to have a title that differs from its filename. For example,
content/rest/reference/orgs.md
has a title ofOrganizations
instead ofOrgs
. Pages with this frontmatter set totrue
will not be flagged in tests or updated byscript/reconcile-ids-with-filenames.js
. - Type:
Boolean
. Default isfalse
. - Optional.
changelog
- Purpose: Render a list of changelog items with timestamps on product pages (ex:
layouts/product-landing.html
) - Type:
Array
, items are objects{ href: string, title: string, date: 'YYYY-MM-DD' }
- 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
learningTracks
- Purpose: Render a list of learning tracks on a product's sub-landing page.
- type:
String
. This should reference learning tracks' names defined indata/learning-tracks/*.yml
. - Optional
*Note: the first learning track is by-default the featured track.
includeGuides
- Purpose: Render a list of articles, filterable by
type
andtopics
. Only applicable when used withlayout: product-sublanding
. - 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 theoverview
,quick_start
,tutorial
,how_to
,reference
. - Optional.
topics
- Purpose: Indicate the topics covered by the article.
- Type:
String
- 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 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 and H3
s in the article by default.
- To make the mini TOC include additional (or fewer) heading levels, you can add
miniTocMaxHeadingLevel
frontmatter to specify the maximum heading level. For example:miniTocMaxHeadingLevel: 4
- To disable the mini TOC for a specific article, you can add this frontmatter:
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.
Versioning
A content file can have two types of versioning:
versions
frontmatter (required)- Determines in which the versions the page is available. See contributing/permalinks for more info.
- Liquid statements in content (optional)
- Conditionally render content depending on the current version being viewed. See contributing/liquid-helpers for more info. Note Liquid conditionals can also appear in
data
andinclude
files.
- Conditionally render content depending on the current version being viewed. See contributing/liquid-helpers for more info. Note Liquid conditionals can also appear in
Free-pro-team vs. GitHub.com versioning
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.
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.
Whitespace control
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' %}
These characters are especially important in index pages comprised of list items.
Links and image paths
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.
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, 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.
Creating new sublanding pages
To create a sublanding page (e.g. Actions' Guide page), create or modify an existing markdown file with these specific frontmatter values:
- Use the sublanding page template by referencing it
layout: product-sublanding
- (optional) Include the learning tracks in
learningTracks
- (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.