Merge branch 'main' into patch-3
This commit is contained in:
3
.github/allowed-actions.js
vendored
3
.github/allowed-actions.js
vendored
@@ -8,6 +8,7 @@ module.exports = [
|
||||
'actions/cache@v2',
|
||||
'actions/checkout@v2',
|
||||
'actions/github-script@0.9.0',
|
||||
'actions/github-script@v2.0.0',
|
||||
'actions/github-script@v2',
|
||||
'actions/github-script@v3',
|
||||
'actions/labeler@v2',
|
||||
@@ -25,6 +26,8 @@ module.exports = [
|
||||
'pascalgn/automerge-action@135f0bdb927d9807b5446f7ca9ecc2c51de03c4a',
|
||||
'peter-evans/create-issue-from-file@v2',
|
||||
'peter-evans/create-pull-request@v2',
|
||||
'rachmari/actions-add-new-issue-to-column@v1.1.1',
|
||||
'rachmari/labeler@v1.0.4',
|
||||
'repo-sync/github-sync@v2',
|
||||
'repo-sync/pull-request@v2',
|
||||
'rtCamp/action-slack-notify@master',
|
||||
|
||||
@@ -84,24 +84,24 @@ The `github` context contains information about the workflow run and the event t
|
||||
| Property name | Type | Description |
|
||||
|---------------|------|-------------|
|
||||
| `github` | `object` | The top-level context available during any job or step in a workflow. |
|
||||
| `github.event` | `object` | The full event webhook payload. For more information, see "[Events that trigger workflows](/articles/events-that-trigger-workflows/)." You can access individual properties of the event using this context. |
|
||||
| `github.event_path` | `string` | The path to the full event webhook payload on the runner. |
|
||||
| `github.workflow` | `string` | The name of the workflow. If the workflow file doesn't specify a `name`, the value of this property is the full path of the workflow file in the repository. |
|
||||
| `github.job` | `string` | The [`job_id`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_id) of the current job. |
|
||||
| `github.run_id` | `string` | {% data reusables.github-actions.run_id_description %} |
|
||||
| `github.run_number` | `string` | {% data reusables.github-actions.run_number_description %} |
|
||||
| `github.action` | `string` | The name of the action currently running. {% data variables.product.prodname_dotcom %} removes special characters or uses the name `run` when the current step runs a script. If you use the same action more than once in the same job, the name will include a suffix with the sequence number. For example, the first script you run will have the name `run1`, and the second script will be named `run2`. Similarly, the second invocation of `actions/checkout` will be `actionscheckout2`. |
|
||||
| `github.action_path` | `string` | The path where your action is located. You can use this path to easily access files located in the same repository as your action. This attribute is only supported in composite run steps actions. |
|
||||
| `github.actor` | `string` | The login of the user that initiated the workflow run. |
|
||||
| `github.base_ref` | `string` | The `base_ref` or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is a `pull_request`. |
|
||||
| `github.event` | `object` | The full event webhook payload. For more information, see "[Events that trigger workflows](/articles/events-that-trigger-workflows/)." You can access individual properties of the event using this context. |
|
||||
| `github.event_name` | `string` | The name of the event that triggered the workflow run. |
|
||||
| `github.event_path` | `string` | The path to the full event webhook payload on the runner. |
|
||||
| `github.head_ref` | `string` | The `head_ref` or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is a `pull_request`. |
|
||||
| `github.job` | `string` | The [`job_id`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_id) of the current job. |
|
||||
| `github.ref` | `string` | The branch or tag ref that triggered the workflow run. |
|
||||
| `github.repository` | `string` | The owner and repository name. For example, `Codertocat/Hello-World`. |
|
||||
| `github.repository_owner` | `string` | The repository owner's name. For example, `Codertocat`. |
|
||||
| `github.event_name` | `string` | The name of the event that triggered the workflow run. |
|
||||
| `github.run_id` | `string` | {% data reusables.github-actions.run_id_description %} |
|
||||
| `github.run_number` | `string` | {% data reusables.github-actions.run_number_description %} |
|
||||
| `github.sha` | `string` | The commit SHA that triggered the workflow run. |
|
||||
| `github.ref` | `string` | The branch or tag ref that triggered the workflow run. |
|
||||
| `github.head_ref` | `string` | The `head_ref` or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is a `pull_request`. |
|
||||
| `github.base_ref` | `string` | The `base_ref` or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is a `pull_request`. |
|
||||
| `github.token` | `string` | A token to authenticate on behalf of the GitHub App installed on your repository. This is functionally equivalent to the `GITHUB_TOKEN` secret. For more information, see "[Authenticating with the GITHUB_TOKEN](/actions/automating-your-workflow-with-github-actions/authenticating-with-the-github_token)." |
|
||||
| `github.workflow` | `string` | The name of the workflow. If the workflow file doesn't specify a `name`, the value of this property is the full path of the workflow file in the repository. |
|
||||
| `github.workspace` | `string` | The default working directory for steps and the default location of your repository when using the [`checkout`](https://github.com/actions/checkout) action. |
|
||||
| `github.action` | `string` | The name of the action currently running. {% data variables.product.prodname_dotcom %} removes special characters or uses the name `run` when the current step runs a script. If you use the same action more than once in the same job, the name will include a suffix with the sequence number. For example, the first script you run will have the name `run1`, and the second script will be named `run2`. Similarly, the second invocation of `actions/checkout` will be `actionscheckout2`. |
|
||||
| `github.action_path` | `string` | The path where your action is located. You can use this path to easily access files located in the same repository as your action. This attribute is only supported in composite run steps actions.
|
||||
|
||||
#### **`env` context**
|
||||
|
||||
@@ -124,14 +124,14 @@ The `job` context contains information about the currently running job.
|
||||
| Property name | Type | Description |
|
||||
|---------------|------|-------------|
|
||||
| `job` | `object` | This context changes for each job in a workflow run. You can access this context from any step in a job. |
|
||||
| `job.status` | `string` | The current status of the job. Possible values are `success`, `failure`, or `cancelled`. |
|
||||
| `job.container` | `object` | Information about the job's container. For more information about containers, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/articles/workflow-syntax-for-github-actions#jobsjob_idcontainer)." |
|
||||
| `job.container.network` | `string` | The id of the container network. The runner creates the network used by all containers in a job. |
|
||||
| `job.container.id` | `string` | The id of the container. |
|
||||
| `job.container.network` | `string` | The id of the container network. The runner creates the network used by all containers in a job. |
|
||||
| `job.services` | `object` | The service containers created for a job. For more information about service containers, see "[Workflow syntax for {% data variables.product.prodname_actions %}](/articles/workflow-syntax-for-github-actions#jobsjob_idservices)." |
|
||||
| `job.services.<service id>.id` | `string` | The id of the service container. |
|
||||
| `job.services.<service id>.ports` | `object` | The exposed ports of the service container. |
|
||||
| `job.services.<service id>.network` | `string` | The id of the service container network. The runner creates the network used by all containers in a job. |
|
||||
| `job.services.<service id>.ports` | `object` | The exposed ports of the service container. |
|
||||
| `job.status` | `string` | The current status of the job. Possible values are `success`, `failure`, or `cancelled`. |
|
||||
|
||||
#### **`steps` context**
|
||||
|
||||
@@ -141,9 +141,9 @@ The `steps` context contains information about the steps in the current job that
|
||||
|---------------|------|-------------|
|
||||
| `steps` | `object` | This context changes for each step in a job. You can access this context from any step in a job. |
|
||||
| `steps.<step id>.outputs` | `object` | The set of outputs defined for the step. For more information, see "[Metadata syntax for {% data variables.product.prodname_actions %}](/articles/metadata-syntax-for-github-actions#outputs)." |
|
||||
| `steps.<step id>.outputs.<output name>` | `string` | The value of a specific output. |
|
||||
| `steps.<step id>.outcome` | `string` | The result of a completed step before [`continue-on-error`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error) is applied. Possible values are `success`, `failure`, `cancelled`, or `skipped`. When a `continue-on-error` step fails, the `outcome` is `failure`, but the final `conclusion` is `success`. |
|
||||
| `steps.<step id>.conclusion` | `string` | The result of a completed step after [`continue-on-error`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error) is applied. Possible values are `success`, `failure`, `cancelled`, or `skipped`. When a `continue-on-error` step fails, the `outcome` is `failure`, but the final `conclusion` is `success`. |
|
||||
| `steps.<step id>.outcome` | `string` | The result of a completed step before [`continue-on-error`](/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error) is applied. Possible values are `success`, `failure`, `cancelled`, or `skipped`. When a `continue-on-error` step fails, the `outcome` is `failure`, but the final `conclusion` is `success`. |
|
||||
| `steps.<step id>.outputs.<output name>` | `string` | The value of a specific output. |
|
||||
|
||||
#### **`runner` context**
|
||||
|
||||
@@ -162,9 +162,9 @@ The `needs` context contains outputs from all jobs that are defined as a depende
|
||||
| Property name | Type | Description |
|
||||
|---------------|------|-------------|
|
||||
| `needs.<job id>` | `object` | A single job that the current job depends on. |
|
||||
| `needs.<job id>.result` | `string` | The result of a job that the current job depends on. Possible values are `success`, `failure`, or `cancelled`. |
|
||||
| `needs.<job id>.outputs` | `object` | The set of outputs of a job that the current job depends on. |
|
||||
| `needs.<job id>.outputs.<output name>` | `string` | The value of a specific output for a job that the current job depends on. |
|
||||
| `needs.<job id>.result` | `string` | The result of a job that the current job depends on. Possible values are `success`, `failure`, or `cancelled`. |
|
||||
|
||||
#### Example printing context information to the log file
|
||||
|
||||
|
||||
@@ -77,15 +77,15 @@ We send security alerts to people with admin permissions in the affected reposit
|
||||
### Configuring notifications for {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}{% data variables.product.prodname_dependabot_alerts %}{% else %}security alerts{% endif %}
|
||||
|
||||
{% if currentVersion == "free-pro-team@latest" %}
|
||||
By default, you will receive {% data variables.product.prodname_dependabot_alerts %} by email, grouped by the specific vulnerability. You can also choose to receive {% data variables.product.prodname_dependabot_alerts %} in a weekly email summarizing alerts for up to 10 of your repositories, in your web notifications, or in the {% data variables.product.product_name %} user interface. For more information, see "[Configuring notifications](/github/managing-subscriptions-and-notifications-on-github/configuring-notifications#github-dependabot-alerts-options)."
|
||||
By default, you will receive {% data variables.product.prodname_dependabot_alerts %} by email, grouped by the specific vulnerability. You can also choose to receive {% data variables.product.prodname_dependabot_alerts %} in a weekly email summarizing alerts for up to 10 of your repositories, in your web notifications, or in the {% data variables.product.product_name %} user interface. For more information, see "[Configuring notifications](/github/managing-subscriptions-and-notifications-on-github/configuring-notifications#github-dependabot-alerts-notification-options)."
|
||||
{% endif %}
|
||||
|
||||
{% if currentVersion != "free-pro-team@latest" and currentVersion ver_gt "enterprise-server@2.21" %}
|
||||
By default, if your site administrator has configured email for notifications on your instance, you will receive {% data variables.product.prodname_dependabot_alerts %} by email. You can also choose to receive {% data variables.product.prodname_dependabot_alerts %} in a weekly email summarizing alerts for up to 10 of your repositories, in your web notifications, or in the {% data variables.product.product_name %} user interface. For more information, see "[Configuring notifications](/github/managing-subscriptions-and-notifications-on-github/configuring-notifications#github-dependabot-alerts-options)."
|
||||
By default, if your site administrator has configured email for notifications on your instance, you will receive {% data variables.product.prodname_dependabot_alerts %} by email. You can also choose to receive {% data variables.product.prodname_dependabot_alerts %} in a weekly email summarizing alerts for up to 10 of your repositories, in your web notifications, or in the {% data variables.product.product_name %} user interface. For more information, see "[Configuring notifications](/github/managing-subscriptions-and-notifications-on-github/configuring-notifications#github-dependabot-alerts-notification-options)."
|
||||
{% endif %}
|
||||
|
||||
{% if currentVersion != "free-pro-team@latest" and currentVersion == "enterprise-server@2.21" %}
|
||||
By default, if your site administrator has configured email for notifications on your instance, you will receive security alerts by email. You can also choose to receive security alerts in a weekly email summarizing alerts for up to 10 of your repositories, in your web notifications, or in the {% data variables.product.product_name %} user interface. For more information, see "[Configuring notifications](/github/managing-subscriptions-and-notifications-on-github/configuring-notifications#security-alert-options)."
|
||||
By default, if your site administrator has configured email for notifications on your instance, you will receive security alerts by email. You can also choose to receive security alerts in a weekly email summarizing alerts for up to 10 of your repositories, in your web notifications, or in the {% data variables.product.product_name %} user interface. For more information, see "[Configuring notifications](/github/managing-subscriptions-and-notifications-on-github/configuring-notifications#security-alert-notification-options)."
|
||||
{% endif %}
|
||||
|
||||
{% if currentVersion != "free-pro-team@latest" and currentVersion ver_lt "enterprise-server@2.21" %}
|
||||
|
||||
@@ -120,8 +120,8 @@ Email notifications from {% data variables.product.product_name %} contain the f
|
||||
3. On the notifications settings page, choose how you receive notifications when:
|
||||
- There are updates in repositories or team discussions you're watching or in a conversation you're participating in. For more information, see "[About participating and watching notifications](#about-participating-and-watching-notifications)."
|
||||
- You gain access to a new repository or you've joined a new team. For more information, see "[Automatic watching](#automatic-watching)."{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}
|
||||
- There are new {% data variables.product.prodname_dependabot_alerts %} in your repository. For more information, see "[{% data variables.product.prodname_dependabot_alerts %} options](#github-dependabot-alerts-options)." {% endif %}{% if currentVersion == "enterprise-server@2.21" %}
|
||||
- There are new security alerts in your repository. For more information, see "[Security alert options](#security-alert-options)." {% endif %} {% if currentVersion == "free-pro-team@latest" %}
|
||||
- There are new {% data variables.product.prodname_dependabot_alerts %} in your repository. For more information, see "[{% data variables.product.prodname_dependabot_alerts %} notification options](#github-dependabot-alerts-notification-options)." {% endif %}{% if currentVersion == "enterprise-server@2.21" %}
|
||||
- There are new security alerts in your repository. For more information, see "[Security alert notification options](#security-alert-notification-options)." {% endif %} {% if currentVersion == "free-pro-team@latest" %}
|
||||
- There are workflow runs updates on repositories set up with {% data variables.product.prodname_actions %}. For more information, see "[{% data variables.product.prodname_actions %} notification options](#github-actions-notification-options)."{% endif %}
|
||||
|
||||
### Automatic watching
|
||||
@@ -158,9 +158,9 @@ If you are a member of more than one organization, you can configure each one to
|
||||

|
||||
|
||||
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}
|
||||
### {% data variables.product.prodname_dependabot_alerts %} options
|
||||
### {% data variables.product.prodname_dependabot_alerts %} notification options
|
||||
{% else %}
|
||||
### Security alert options
|
||||
### Security alert notification options
|
||||
{% endif %}
|
||||
|
||||
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}Choose how you want to receive {% data variables.product.prodname_dependabot_alerts %} for repositories that you are watching. You can receive {% data variables.product.prodname_dependabot_alerts %} in your inbox, as a banner on {% data variables.product.product_name %}, on the command line, through email, or some combination of these options.
|
||||
@@ -177,6 +177,12 @@ If you want to receive security alerts by email, choose whether you want a weekl
|
||||

|
||||
{% endif %}
|
||||
|
||||
{% note %}
|
||||
|
||||
**Note:** You can filter your {% data variables.product.company_short %} inbox notifications by {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}{% data variables.product.prodname_dependabot_short %}{% else %} security{% endif %} alerts. For more information, see "[Managing notifications from your inbox](/github/managing-subscriptions-and-notifications-on-github/managing-notifications-from-your-inbox#supported-queries-for-custom-filters)."
|
||||
|
||||
{% endnote %}
|
||||
|
||||
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}
|
||||
|
||||
### {% data variables.product.prodname_actions %} notification options
|
||||
|
||||
@@ -112,7 +112,7 @@ To filter notifications by why you've received an update, you can use the `reaso
|
||||
|
||||
#### Supported `is:` queries
|
||||
|
||||
To filter notifications for specific activity on {% data variables.product.product_name %}, you can use the `is` query. For example, to only see repository invitation updates, use `is:repository-invitation`.
|
||||
To filter notifications for specific activity on {% data variables.product.product_name %}, you can use the `is` query. For example, to only see repository invitation updates, use `is:repository-invitation`, and to only see {% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}{% data variables.product.prodname_dependabot_short %}{% else %} security{% endif %} alerts, use `is:repository-vulnerability-alert`.
|
||||
|
||||
- `is:check-suite`
|
||||
- `is:commit`
|
||||
|
||||
@@ -82,9 +82,9 @@ Since the number and names of cookies may change,the table below may be updated
|
||||
| Google Analytics** | `_gat` | This cookie is used by Google Analytics. | one minute |
|
||||
| Google Analytics** | `_gid` | This cookie is used by Google Analytics. | one day |
|
||||
|
||||
*The **expiration** dates for the cookies listed below generally apply on a rolling basis.
|
||||
_*_ The **expiration** dates for the cookies listed below generally apply on a rolling basis.
|
||||
|
||||
**We use <b>Google Analytics</b> as a third party analytics service to collect information about how our website performs and how our users, in general, navigate through and use GitHub. This helps us evaluate our users' use of GitHub, compile statistical reports on activity, and improve our content and website performance.
|
||||
_**_ We use **Google Analytics** as a third party analytics service to collect information about how our website performs and how our users, in general, navigate through and use GitHub. This helps us evaluate our users' use of GitHub, compile statistical reports on activity, and improve our content and website performance.
|
||||
|
||||
You can control your Google Analytics cookie preferences through our cookie preference link located at the footer of our website. In addition, Google provides further information about its own privacy practices and [offers a browser add-on to opt out of Google Analytics tracking](https://tools.google.com/dlpage/gaoptout).
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ This site is powered by Node.js! :sparkles: :turtle: :rocket: :sparkles:
|
||||
|
||||
It runs on macOS, Windows, and Linux environments.
|
||||
|
||||
You'll need **Node.js v14** to run the site. If you're using [`nodenv`](https://github.com/nodenv/nodenv), read the [`nodenv` docs](#nodenv) for instructions on switching Node.js versions. If you're not using `nodenv`, the best way to install Node.js is to [download the LTS installer from nodejs.org](https://nodejs.org).
|
||||
You'll need Node.js version 12 or 14 to run the site. To install Node.js, [download the "LTS" installer from nodejs.org](https://nodejs.org). If you're using [`nodenv`](https://github.com/nodenv/nodenv), read the [`nodenv` docs](#nodenv) for instructions on switching Node.js versions.
|
||||
|
||||
Once you've installed Node.js (which includes the popular `npm` package manager), open Terminal and run the following:
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# Node Versions
|
||||
|
||||
The site currently runs on Node.js v14, the [Active LTS version](https://nodejs.org/en/about/releases/) from 2020-10-27 to 2021-10-26.
|
||||
In [development](contributing/development.md) enviroments this site will run on Node.js versions `12 - 14`.
|
||||
|
||||
In [staging and production](contributing/deployments.md) environments this site runs on Node.js 14, the [Active LTS version](https://nodejs.org/en/about/releases/) from 2020-10-27 to 2021-10-26).
|
||||
|
||||
When updating to a new Node.js version, consider the following files:
|
||||
|
||||
|
||||
@@ -19,17 +19,23 @@ function actionsUsedInWorkflow (workflow) {
|
||||
.map(key => get(workflow, key))
|
||||
}
|
||||
|
||||
describe('GitHub Actions workflows', () => {
|
||||
test('only use allowed actions from ./github/allow-actions.json', async () => {
|
||||
const allUsedActions = chain(workflows)
|
||||
const allUsedActions = chain(workflows)
|
||||
.map(actionsUsedInWorkflow)
|
||||
.flatten()
|
||||
.uniq()
|
||||
.sort()
|
||||
.value()
|
||||
|
||||
expect(allowedActions.length).toBeGreaterThan(0)
|
||||
describe('GitHub Actions workflows', () => {
|
||||
test('all used actions are allowed in .github/allowed-actions.js', () => {
|
||||
expect(allUsedActions.length).toBeGreaterThan(0)
|
||||
expect(difference(allowedActions, allUsedActions)).toEqual([])
|
||||
const unusedActions = difference(allowedActions, allUsedActions)
|
||||
expect(unusedActions).toEqual([])
|
||||
})
|
||||
|
||||
test('all allowed actions by .github/allowed-actions.js are used by at least one workflow', () => {
|
||||
expect(allowedActions.length).toBeGreaterThan(0)
|
||||
const disallowedActions = difference(allUsedActions, allowedActions)
|
||||
expect(disallowedActions).toEqual([])
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,279 +0,0 @@
|
||||
# Content
|
||||
|
||||
The `/content` directory is where all the site's (English) Markdown content lives!
|
||||
|
||||
See the [Markup Reference Guide](https://github.com/github/product-documentation/blob/master/doc-team-workflows/workflow-information-for-all-writers/markup-reference.md) in the `product-documentation` repo for more info about supported Markdown features.
|
||||
|
||||
See the top-level [README](../README.md) for general info about how the site works.
|
||||
|
||||
- [Frontmatter](#frontmatter)
|
||||
- [`hidden`](#hidden)
|
||||
- [`productVersions`](#productversions)
|
||||
- [`redirect_from`](#redirect_from)
|
||||
- [`title`](#title)
|
||||
- [`intro`](#intro)
|
||||
- [`layout`](#layout)
|
||||
- [`mapTopic`](#maptopic)
|
||||
- [Escaping single quotes](#escaping-single-quotes)
|
||||
- [Index Pages](#index-pages)
|
||||
- [Dotcom index page](#dotcom-index-page)
|
||||
- [Hidden Pages](#hidden-pages)
|
||||
- [Category Pages](#category-pages)
|
||||
- [Map Topic Pages](#map-topic-pages)
|
||||
- [Versioning](#versioning)
|
||||
- [Filenames](#filenames)
|
||||
- [Whitespace Control](#whitespace-control)
|
||||
- [Links and image paths](#links-and-image-paths)
|
||||
|
||||
## Frontmatter
|
||||
|
||||
[YAML Frontmatter](https://jekyllrb.com/docs/front-matter/) 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:
|
||||
|
||||
### `hidden`
|
||||
|
||||
- Purpose: Indicates whether a page should be excluded from searches, crawlers, TOCs, etc. See [Hidden Pages](#hidden-pages) for more info.
|
||||
- Type: `Boolean`. Default is `false`.
|
||||
|
||||
### `productVersions`
|
||||
|
||||
- Purpose: Indicates the products and product versions to which a page applies. See [Versioning](#versioning) for more info.
|
||||
- Type: `Object`. Allowable keys are `dotcom` and `enterprise`
|
||||
- This frontmatter value is currently **required** for all pages.
|
||||
|
||||
Example that applies to GitHub.com and recent versions of GitHub Enterprise:
|
||||
|
||||
```yml
|
||||
title: About your personal dashboard
|
||||
productVersions:
|
||||
dotcom: '*'
|
||||
enterprise: '>=2.14'
|
||||
```
|
||||
|
||||
Example that applies to all supported versions of GitHub enterprise (but not GitHub.com):
|
||||
|
||||
```yml
|
||||
title: Downloading your license
|
||||
productVersions:
|
||||
enterprise: '*'
|
||||
```
|
||||
|
||||
Note: `dotcom` is an evergreen product without versions, so the `*` is used to denote all versions.
|
||||
|
||||
### `redirect_from`
|
||||
|
||||
- Purpose: List URLs that should redirect to this page.
|
||||
- Type: `Array` (for multiple redirects) or `String` (for just one)
|
||||
- 任意
|
||||
|
||||
Example with multiple redirects:
|
||||
|
||||
```yml
|
||||
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/
|
||||
```
|
||||
|
||||
Example with a single redirect:
|
||||
|
||||
```yml
|
||||
title: Denying access to a previously approved OAuth App for your organization
|
||||
redirect_from: /articles/denying-access-to-a-previously-approved-application-for-your-organization/
|
||||
```
|
||||
|
||||
See [README#redirects](../README#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 Entperprise`.
|
||||
|
||||
### `intro`
|
||||
|
||||
- Purpose: Sets the intro for the article.
|
||||
- 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 named `layouts/article.html`, the value would be `article`.
|
||||
- Optional. If omitted, `layouts/default.html` is used.
|
||||
|
||||
### `mapTopic`
|
||||
|
||||
- Purpose: Indicates whether a page is a map topic. See [Map Topic Pages](#map-topic-pages) for more info.
|
||||
- Type: `Boolean`. Default is `false`.
|
||||
- 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](https://yaml.org/spec/history/2001-12-10.html):
|
||||
|
||||
> 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.
|
||||
|
||||
## Index Pages
|
||||
|
||||
Index pages are written in Markdown, and are always named `index.md`. They exist as landing pages dedicated to specific GitHub products or topical groupings of articles. Each index page contains a Table of Contents (TOC) with links to articles.
|
||||
|
||||
Product indexes:
|
||||
|
||||
| Filename | URL Path | 目的 |
|
||||
| ---------------------------- | ------------------------------------------------------------- | -------------------------------------------- |
|
||||
| `/index.md` | [/](https://help.github.com/) | GitHub.com and GitHub Enterprise "User" Docs |
|
||||
| `/enterprise/index.md` | [/enterprise](https://help.github.com/enterprise) | GitHub Enterprise |
|
||||
| `/enterprise/admin/index.md` | [/enterprise/admin](https://help.github.com/enterprise/admin) | Enterprise Admin |
|
||||
| `/desktop/index.md` | [/desktop](https://help.github.com/desktop) | Desktop |
|
||||
|
||||
GitHub Enterprise Admin also has index pages:
|
||||
|
||||
| Filename | URL Path | 目的 |
|
||||
| ----------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------ |
|
||||
| `/enterprise/admin/clustering/index.md` | [/enterprise/admin/clustering](https://help.github.com/enterprise/admin/clustering) | Clustering |
|
||||
| `/enterprise/admin/developer-workflow/index.md` | [/enterprise/admin/developer-workflow](https://help.github.com/enterprise/admin/developer-workflow) | Developer Workflow |
|
||||
| `/enterprise/admin/enterprise-support/index.md` | [/enterprise/admin/enterprise-support](https://help.github.com/enterprise/admin/enterprise-support) | Enterprise Support |
|
||||
| `/enterprise/admin/installation/index.md` | [/enterprise/admin/installation](https://help.github.com/enterprise/admin/installation) | Installation |
|
||||
| `/enterprise/admin/migrations/index.md` | [/enterprise/admin/migrations](https://help.github.com/enterprise/admin/migrations) | Migrations |
|
||||
| `/enterprise/admin/user-management/index.md` | [/enterprise/admin/user-management](https://help.github.com/enterprise/admin/user-management) | ユーザ管理 |
|
||||
|
||||
See <enterprise/admin/README.md> for details on how guides should be written.
|
||||
|
||||
Desktop guides also have index pages:
|
||||
|
||||
| Filename | URL Path | 目的 |
|
||||
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
|
||||
| `/desktop/contributing-to-projects` | [/desktop/contributing-to-projects](https://help.github.com/desktop/contributing-to-projects) | Contributing to Projects |
|
||||
| `/desktop/getting-started-with-github-desktop` | [/desktop/getting-started-with-github-desktop](https://help.github.com/desktop/getting-started-with-github-desktop) | Getting Started with GitHub Desktop |
|
||||
|
||||
**Note**: All links to GitHub Desktop Classic (such as `https://help.github.com/desktop-classic`) now redirect to https://desktop.github.com.
|
||||
|
||||
### Dotcom index page
|
||||
|
||||
The file `content/index.md` is rendered as a long TOC on the https://help.github.com homepage.
|
||||
|
||||
The formatting of this file must adhere to a specific structure in order for the site to render the page properly and create automatic links to articles:
|
||||
|
||||
| Content type | Formatting | サンプル |
|
||||
| ----------------------------- | ---------- | ------------------------------------ |
|
||||
| [Category](#category-pages) | `h2` | `## Bootcamp` |
|
||||
| [Map topic](#map-topic-pages) | `h3` | `### Managing user account settings` |
|
||||
| Article | List item | `- Set up git` |
|
||||
|
||||
See [Whitespace Control](#whitespace-control) for info on using Liquid conditionals within TOC lists.
|
||||
|
||||
## Hidden Pages
|
||||
|
||||
Hidden pages are publicly accessible but excluded from the search index, and they're not linked to by any other pages.
|
||||
|
||||
In development, you can view a list of all hidden pages by visiting [localhost:4000/hidden](http://localhost:4000/hidden). Note, however, that this page is not available in production.
|
||||
|
||||
To make a page hidden, add `hidden: true` to its YAML frontmatter.
|
||||
|
||||
## Category Pages
|
||||
|
||||
Category pages are only found in Dotcom docs (e.g., https://help.github.com/categories/bootcamp). The content displayed on these pages is autogenerated from the category's parent [index page](#dotcom-index-pages), where the name of the category is an `h2`.
|
||||
|
||||
Every category in the index page must have a corresponding placeholder file in `content/dotcom/categories` ending in `.md`. You can add redirects to the placeholder files.
|
||||
|
||||
## Map Topic Pages
|
||||
|
||||
Map topics are found in Dotcom, Enterprise Admin, and Desktop docs. The content displayed on these pages is autogenerated from each map topic's parent [index page](#index-pages). Map topic files live alongside article files.
|
||||
|
||||
To make a page a map topic, add `mapTopic: true` to its YAML frontmatter and leave the rest of the file empty.
|
||||
|
||||
## Versioning
|
||||
|
||||
Versioning for any content file lives in **two** places:
|
||||
|
||||
- The file's [`productVersions`](#productversions) frontmatter.
|
||||
- Liquid conditionals in the file's parent [index page](#index-pages).
|
||||
|
||||
For example, an article with this frontmatter:
|
||||
|
||||
```yml
|
||||
title: About your personal dashboard
|
||||
productVersions:
|
||||
dotcom: '*'
|
||||
enterprise: '>=2.14'
|
||||
```
|
||||
|
||||
should be referenced in the parent index page like this:
|
||||
{%- if page.version == 'dotcom' or page.version ver_gt "2.13" %}
|
||||
- About your personal dashboard
|
||||
{%- endif %}
|
||||
## Filenames
|
||||
|
||||
The site automatically creates links to articles in index pages. For example, this block in `content/index.md`:
|
||||
|
||||
## Bootcamp
|
||||
|
||||
- Set up git
|
||||
- Create a repo
|
||||
- Fork a repo
|
||||
- Be social
|
||||
|
||||
|
||||
renders with links to each article.
|
||||
|
||||
If you're adding a new article, make sure the filename is a [kebab-cased](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles) version of the title you use in both the article and the parent index. This can get tricky when a title has punctuation (such as "GitHub's Billing Plans"). If you're not sure what the filename should be based on the title, you can find out by adding the title to the TOC. 例:
|
||||
|
||||
## Bootcamp
|
||||
|
||||
- Set up git
|
||||
- Create a repo
|
||||
- Fork a repo
|
||||
- Be social
|
||||
- I'm a new article
|
||||
|
||||
|
||||
Then just run the site locally and see what the link is. In this example, the filename would be: `im-a-new-article`
|
||||
|
||||
## Whitespace Control
|
||||
|
||||
When using Liquid conditionals in lists or tables, you can use [whitespace control](https://shopify.github.io/liquid/basics/whitespace/) 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 page.version == 'dotcom' %}
|
||||
These characters are especially important in [index pages](#index-pages) comprised of list items.
|
||||
|
||||
## Links and image paths
|
||||
|
||||
Any local links (like those starting with `/articles/`) and image paths (starting with `/assets`) that you include in content and data files will undergo some transformations on the server side to match the current page's language and Enterprise version (if applicable). The handling for these transformations lives in [`lib/rewrite-local-links`](lib/rewrite-local-links.js) and [`lib/rewrite-asset-paths-to-s3`](lib/rewrite-asset-paths-to-s3.js).
|
||||
|
||||
For example, if you include the following link in a content file:
|
||||
|
||||
/articles/creating-a-saved-reply
|
||||
|
||||
|
||||
When viewed on Dotcom, the link gets rendered with the language code:
|
||||
|
||||
/en/articles/creating-a-saved-reply
|
||||
|
||||
|
||||
and when viewed on GHE, the version is included as well:
|
||||
|
||||
/en/enterprise/2.16/user/articles/creating-a-saved-reply
|
||||
|
||||
|
||||
The transformation is a little simpler for image paths. If you include the following image path in a content file:
|
||||
|
||||
/assets/images/help/profile/follow-user-button.png
|
||||
|
||||
|
||||
when viewed on GHE, the path gets rewritten to include S3:
|
||||
|
||||
https://github-images.s3.amazonaws.com/enterprise/2.16/assets/images/help/profile/follow-user-button.png
|
||||
|
||||
|
||||
### 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`. 例:
|
||||
|
||||
<a href="/articles/github-terms-of-service/" class="dotcom-only">GitHub's Terms of Service</a>
|
||||
|
||||
|
||||
Sometimes the canonical home of content moves outside the help site. None of the links included in [`lib/external-redirects.json`](lib/external-redirects.json) get rewritten. See the top-level [README](../README.md#external-redirects) for more info about this type of redirect.
|
||||
@@ -1,279 +0,0 @@
|
||||
# Content
|
||||
|
||||
The `/content` directory is where all the site's (English) Markdown content lives!
|
||||
|
||||
See the [Markup Reference Guide](https://github.com/github/product-documentation/blob/master/doc-team-workflows/workflow-information-for-all-writers/markup-reference.md) in the `product-documentation` repo for more info about supported Markdown features.
|
||||
|
||||
See the top-level [README](../README.md) for general info about how the site works.
|
||||
|
||||
- [Frontmatter](#frontmatter)
|
||||
- [`hidden`](#hidden)
|
||||
- [`productVersions`](#productversions)
|
||||
- [`redirect_from`](#redirect_from)
|
||||
- [`title`](#title)
|
||||
- [`intro`](#intro)
|
||||
- [`layout`](#layout)
|
||||
- [`mapTopic`](#maptopic)
|
||||
- [Escaping single quotes](#escaping-single-quotes)
|
||||
- [Index Pages](#index-pages)
|
||||
- [Dotcom index page](#dotcom-index-page)
|
||||
- [Hidden Pages](#hidden-pages)
|
||||
- [Category Pages](#category-pages)
|
||||
- [Map Topic Pages](#map-topic-pages)
|
||||
- [Versioning](#versioning)
|
||||
- [Filenames](#filenames)
|
||||
- [Whitespace Control](#whitespace-control)
|
||||
- [Links and image paths](#links-and-image-paths)
|
||||
|
||||
## Frontmatter
|
||||
|
||||
[YAML Frontmatter](https://jekyllrb.com/docs/front-matter/) 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:
|
||||
|
||||
### `hidden`
|
||||
|
||||
- Purpose: Indicates whether a page should be excluded from searches, crawlers, TOCs, etc. See [Hidden Pages](#hidden-pages) for more info.
|
||||
- Type: `Boolean`. Default is `false`.
|
||||
|
||||
### `productVersions`
|
||||
|
||||
- Purpose: Indicates the products and product versions to which a page applies. See [Versioning](#versioning) for more info.
|
||||
- Type: `Object`. Allowable keys are `dotcom` and `enterprise`
|
||||
- This frontmatter value is currently **required** for all pages.
|
||||
|
||||
Example that applies to GitHub.com and recent versions of GitHub Enterprise:
|
||||
|
||||
```yml
|
||||
title: About your personal dashboard
|
||||
productVersions:
|
||||
dotcom: '*'
|
||||
enterprise: '>=2.14'
|
||||
```
|
||||
|
||||
Example that applies to all supported versions of GitHub enterprise (but not GitHub.com):
|
||||
|
||||
```yml
|
||||
title: Downloading your license
|
||||
productVersions:
|
||||
enterprise: '*'
|
||||
```
|
||||
|
||||
Note: `dotcom` is an evergreen product without versions, so the `*` is used to denote all versions.
|
||||
|
||||
### `redirect_from`
|
||||
|
||||
- Purpose: List URLs that should redirect to this page.
|
||||
- Type: `Array` (for multiple redirects) or `String` (for just one)
|
||||
- Optional
|
||||
|
||||
Example with multiple redirects:
|
||||
|
||||
```yml
|
||||
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/
|
||||
```
|
||||
|
||||
Example with a single redirect:
|
||||
|
||||
```yml
|
||||
title: Denying access to a previously approved OAuth App for your organization
|
||||
redirect_from: /articles/denying-access-to-a-previously-approved-application-for-your-organization/
|
||||
```
|
||||
|
||||
See [README#redirects](../README#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 Entperprise`.
|
||||
|
||||
### `intro`
|
||||
|
||||
- Purpose: Sets the intro for the article.
|
||||
- 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 named `layouts/article.html`, the value would be `article`.
|
||||
- Optional. If omitted, `layouts/default.html` is used.
|
||||
|
||||
### `mapTopic`
|
||||
|
||||
- Purpose: Indicates whether a page is a map topic. See [Map Topic Pages](#map-topic-pages) for more info.
|
||||
- Type: `Boolean`. Default is `false`.
|
||||
- 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](https://yaml.org/spec/history/2001-12-10.html):
|
||||
|
||||
> 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.
|
||||
|
||||
## Index Pages
|
||||
|
||||
Index pages are written in Markdown, and are always named `index.md`. They exist as landing pages dedicated to specific GitHub products or topical groupings of articles. Each index page contains a Table of Contents (TOC) with links to articles.
|
||||
|
||||
Product indexes:
|
||||
|
||||
| Filename | URL Path | Purpose |
|
||||
| ---------------------------- | ------------------------------------------------------------- | -------------------------------------------- |
|
||||
| `/index.md` | [/](https://help.github.com/) | GitHub.com and GitHub Enterprise "User" Docs |
|
||||
| `/enterprise/index.md` | [/enterprise](https://help.github.com/enterprise) | GitHub Enterprise |
|
||||
| `/enterprise/admin/index.md` | [/enterprise/admin](https://help.github.com/enterprise/admin) | Enterprise Admin |
|
||||
| `/desktop/index.md` | [/desktop](https://help.github.com/desktop) | Desktop |
|
||||
|
||||
GitHub Enterprise Admin also has index pages:
|
||||
|
||||
| Filename | URL Path | Purpose |
|
||||
| ----------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------ |
|
||||
| `/enterprise/admin/clustering/index.md` | [/enterprise/admin/clustering](https://help.github.com/enterprise/admin/clustering) | Clustering |
|
||||
| `/enterprise/admin/developer-workflow/index.md` | [/enterprise/admin/developer-workflow](https://help.github.com/enterprise/admin/developer-workflow) | Developer Workflow |
|
||||
| `/enterprise/admin/enterprise-support/index.md` | [/enterprise/admin/enterprise-support](https://help.github.com/enterprise/admin/enterprise-support) | Enterprise Support |
|
||||
| `/enterprise/admin/installation/index.md` | [/enterprise/admin/installation](https://help.github.com/enterprise/admin/installation) | Installation |
|
||||
| `/enterprise/admin/migrations/index.md` | [/enterprise/admin/migrations](https://help.github.com/enterprise/admin/migrations) | Migrations |
|
||||
| `/enterprise/admin/user-management/index.md` | [/enterprise/admin/user-management](https://help.github.com/enterprise/admin/user-management) | User Management |
|
||||
|
||||
See <enterprise/admin/README.md> for details on how guides should be written.
|
||||
|
||||
Desktop guides also have index pages:
|
||||
|
||||
| Filename | URL Path | Purpose |
|
||||
| ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
|
||||
| `/desktop/contributing-to-projects` | [/desktop/contributing-to-projects](https://help.github.com/desktop/contributing-to-projects) | Contributing to Projects |
|
||||
| `/desktop/getting-started-with-github-desktop` | [/desktop/getting-started-with-github-desktop](https://help.github.com/desktop/getting-started-with-github-desktop) | Getting Started with GitHub Desktop |
|
||||
|
||||
**Note**: All links to GitHub Desktop Classic (such as `https://help.github.com/desktop-classic`) now redirect to https://desktop.github.com.
|
||||
|
||||
### Dotcom index page
|
||||
|
||||
The file `content/index.md` is rendered as a long TOC on the https://help.github.com homepage.
|
||||
|
||||
The formatting of this file must adhere to a specific structure in order for the site to render the page properly and create automatic links to articles:
|
||||
|
||||
| Content type | Formatting | Example |
|
||||
| ----------------------------- | ---------- | ------------------------------------ |
|
||||
| [Category](#category-pages) | `h2` | `## Bootcamp` |
|
||||
| [Map topic](#map-topic-pages) | `h3` | `### Managing user account settings` |
|
||||
| Article | List item | `- Set up git` |
|
||||
|
||||
See [Whitespace Control](#whitespace-control) for info on using Liquid conditionals within TOC lists.
|
||||
|
||||
## Hidden Pages
|
||||
|
||||
Hidden pages are publicly accessible but excluded from the search index, and they're not linked to by any other pages.
|
||||
|
||||
In development, you can view a list of all hidden pages by visiting [localhost:4000/hidden](http://localhost:4000/hidden). Note, however, that this page is not available in production.
|
||||
|
||||
To make a page hidden, add `hidden: true` to its YAML frontmatter.
|
||||
|
||||
## Category Pages
|
||||
|
||||
Category pages are only found in Dotcom docs (e.g., https://help.github.com/categories/bootcamp). The content displayed on these pages is autogenerated from the category's parent [index page](#dotcom-index-pages), where the name of the category is an `h2`.
|
||||
|
||||
Every category in the index page must have a corresponding placeholder file in `content/dotcom/categories` ending in `.md`. You can add redirects to the placeholder files.
|
||||
|
||||
## Map Topic Pages
|
||||
|
||||
Map topics are found in Dotcom, Enterprise Admin, and Desktop docs. The content displayed on these pages is autogenerated from each map topic's parent [index page](#index-pages). Map topic files live alongside article files.
|
||||
|
||||
To make a page a map topic, add `mapTopic: true` to its YAML frontmatter and leave the rest of the file empty.
|
||||
|
||||
## Versioning
|
||||
|
||||
Versioning for any content file lives in **two** places:
|
||||
|
||||
- The file's [`productVersions`](#productversions) frontmatter.
|
||||
- Liquid conditionals in the file's parent [index page](#index-pages).
|
||||
|
||||
For example, an article with this frontmatter:
|
||||
|
||||
```yml
|
||||
title: About your personal dashboard
|
||||
productVersions:
|
||||
dotcom: '*'
|
||||
enterprise: '>=2.14'
|
||||
```
|
||||
|
||||
should be referenced in the parent index page like this:
|
||||
{%- if page.version == 'dotcom' or page.version ver_gt "2.13" %}
|
||||
- About your personal dashboard
|
||||
{%- endif %}
|
||||
## Filenames
|
||||
|
||||
The site automatically creates links to articles in index pages. For example, this block in `content/index.md`:
|
||||
|
||||
## Bootcamp
|
||||
|
||||
- Set up git
|
||||
- Create a repo
|
||||
- Fork a repo
|
||||
- Be social
|
||||
|
||||
|
||||
renders with links to each article.
|
||||
|
||||
If you're adding a new article, make sure the filename is a [kebab-cased](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles) version of the title you use in both the article and the parent index. This can get tricky when a title has punctuation (such as "GitHub's Billing Plans"). If you're not sure what the filename should be based on the title, you can find out by adding the title to the TOC. For example:
|
||||
|
||||
## Bootcamp
|
||||
|
||||
- Set up git
|
||||
- Create a repo
|
||||
- Fork a repo
|
||||
- Be social
|
||||
- I'm a new article
|
||||
|
||||
|
||||
Then just run the site locally and see what the link is. In this example, the filename would be: `im-a-new-article`
|
||||
|
||||
## Whitespace Control
|
||||
|
||||
When using Liquid conditionals in lists or tables, you can use [whitespace control](https://shopify.github.io/liquid/basics/whitespace/) 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 page.version == 'dotcom' %}
|
||||
These characters are especially important in [index pages](#index-pages) comprised of list items.
|
||||
|
||||
## Links and image paths
|
||||
|
||||
Any local links (like those starting with `/articles/`) and image paths (starting with `/assets`) that you include in content and data files will undergo some transformations on the server side to match the current page's language and Enterprise version (if applicable). The handling for these transformations lives in [`lib/rewrite-local-links`](lib/rewrite-local-links.js) and [`lib/rewrite-asset-paths-to-s3`](lib/rewrite-asset-paths-to-s3.js).
|
||||
|
||||
For example, if you include the following link in a content file:
|
||||
|
||||
/articles/creating-a-saved-reply
|
||||
|
||||
|
||||
When viewed on Dotcom, the link gets rendered with the language code:
|
||||
|
||||
/en/articles/creating-a-saved-reply
|
||||
|
||||
|
||||
and when viewed on GHE, the version is included as well:
|
||||
|
||||
/en/enterprise/2.16/user/articles/creating-a-saved-reply
|
||||
|
||||
|
||||
The transformation is a little simpler for image paths. If you include the following image path in a content file:
|
||||
|
||||
/assets/images/help/profile/follow-user-button.png
|
||||
|
||||
|
||||
when viewed on GHE, the path gets rewritten to include S3:
|
||||
|
||||
https://github-images.s3.amazonaws.com/enterprise/2.16/assets/images/help/profile/follow-user-button.png
|
||||
|
||||
|
||||
### 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="/articles/github-terms-of-service/" class="dotcom-only">GitHub's Terms of Service</a>
|
||||
|
||||
|
||||
Sometimes the canonical home of content moves outside the help site. None of the links included in [`lib/external-redirects.json`](lib/external-redirects.json) get rewritten. See the top-level [README](../README.md#external-redirects) for more info about this type of redirect.
|
||||
Reference in New Issue
Block a user