Skip to content

Commit

Permalink
Merge branch 'main' into onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
zeke authored Oct 6, 2020
2 parents 9be6d1d + e00e1a2 commit 5654ab4
Show file tree
Hide file tree
Showing 15 changed files with 119 additions and 192 deletions.
11 changes: 11 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Configuration for welcome - https://github.com/behaviorbot/welcome

# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
# Comment to be posted to on first time issues
newIssueWelcomeComment: >
Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the [contributing guidelines](https://github.com/github/docs/blob/main/CONTRIBUTING.md).
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
# Comment to be posted to on PRs from first time contributors in your repository
newPRWelcomeComment: >
Thanks for opening this pull request! A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the [contributing guidelines](https://github.com/github/docs/blob/main/CONTRIBUTING.md).
2 changes: 1 addition & 1 deletion .github/workflows/sync-algolia-search-indices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "12.x"
node-version: 14.x
- name: cache node modules
uses: actions/cache@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- name: Get npm cache directory
id: npm-cache
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- name: Get npm cache directory
id: npm-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- name: Get npm cache directory
id: npm-cache
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- name: Get npm cache directory
id: npm-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- name: Get npm cache directory
id: npm-cache
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 14.x

- name: Get npm cache directory
id: npm-cache
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
12.8.0
14.13.0
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# INSTALLATION IMAGE
# A temporary image that installs production-only dependencies

FROM node:12-alpine as installation
FROM node:14-alpine as installation
ENV NODE_ENV production
WORKDIR /usr/src/docs
COPY package*.json ./
Expand All @@ -18,7 +18,7 @@ RUN npm ci
# BUNDLE IMAGE
# A temporary image that installs dependencies and builds the production-ready front-end bundles.

FROM node:12-alpine as bundles
FROM node:14-alpine as bundles
WORKDIR /usr/src/docs
# Install the files used to create the bundles
COPY package*.json ./
Expand All @@ -32,7 +32,7 @@ RUN npm ci && npm run build
# --------------------------------------------------------------------------------
# MAIN IMAGE

FROM node:12-alpine
FROM node:14-alpine

# Let's make our home
WORKDIR /usr/src/docs
Expand Down
128 changes: 36 additions & 92 deletions content/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

The `/content` directory is where all the site's (English) Markdown content lives!

See the [markup reference guide](contribution/content-markup-reference.md) for more information about supported Markdown features.
See the [markup reference guide](contributing/content-markup-reference.md) for more information about supported Markdown features.

See the repository's top-level [README](../README.md) for general information about how the site works.
See the [contributing docs](contributing) for general information about working with the docs.

- [Frontmatter](#frontmatter)
- [`productVersions`](#productversions)
- [`versions`](#versions)
- [`redirect_from`](#redirect_from)
- [`title`](#title)
- [`shortTitle`](#shorttitle)
Expand Down Expand Up @@ -38,48 +38,39 @@ The following frontmatter values have special meanings and requirements for this
There's also a schema that's used by the test suite to validate every page's frontmatter.
See [`lib/frontmatter.js`](../lib/frontmatter.js).

### `productVersions`
### `versions`

- Purpose: Indicates the products and product versions to which a page applies.
- Purpose: Indicates the [versions](../lib/all-versions.js) to which a page applies.
See [Versioning](#versioning) for more info.
- Type: `Object`. Allowable keys map to product names and can be found in the `productVersions` object in [`lib/frontmatter.js`](../lib/frontmatter.js).
- Type: `Object`. Allowable keys map to product names and can be found in the `versions` object in [`lib/frontmatter.js`](../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:
Example that applies to GitHub.com and recent versions of GitHub Enterprise Server:

```yml
title: About your personal dashboard
productVersions:
dotcom: '*'
enterprise: '>=2.14'
versions:
free-pro-team: '*'
enterprise-server: '>=2.20'
```
Example that applies to all supported versions of GitHub enterprise
Example that applies to all supported versions of GitHub Enterprise Server:
(but not GitHub.com):
```yml
title: Downloading your license
productVersions:
enterprise: '*'
versions:
enterprise-server: '*'
```
Example that applies to GitHub Actions:
```yml
title: Building actions
productVersions:
actions: '*'
```
Note: Every product except `enterprise` is an evergreen product without specific 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)
- Type: `Array`
- Optional

Example with multiple redirects:
Example:

```yml
title: Getting started with GitHub Desktop
Expand All @@ -89,14 +80,7 @@ redirect_from:
- /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.md#redirects) for more info.
See [`contributing/redirects`](contributing/redirects.md) for more info.

### `title`

Expand All @@ -108,7 +92,7 @@ See [README#redirects](../README.md#redirects) for more info.

- Purpose: An abbreviated variant of the page title for use in breadcrumbs.
- Type: `String`
- Optional. If omitted, `title` will be used. Used only for map topic and category pages.
- Optional. If omitted, `title` will be used.

Example:

Expand Down Expand Up @@ -163,7 +147,7 @@ For a layout named `layouts/article.html`, the value would be `article`.
### `miniTocMaxHeadingLevel`

- Purpose: Indicates the maximum heading level to include in an article's mini TOC. See [Autogenerated mini TOCs](#autogenerated-mini-tocs) for more info.
- Type: `Number`. Default is `3`. Minimum is `2`. Maximum is `4` for now. (If we need to add more levels, we can revisit this. We will need to add CSS to do deeper nesting.)
- Type: `Number`. Default is `3`. Minimum is `2`. Maximum is `4`.
- Optional.

### `allowTitleToDifferFromFilename`
Expand Down Expand Up @@ -193,56 +177,16 @@ Make sure not to add hardcoded "In this article" sections in the Markdown source

## 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:
A content file can have **two** types of versioning:

```
{%- if page.version == 'dotcom' or page.version ver_gt "2.13" %}
- About your personal dashboard
{%- endif %}
```
* [`versions`](#versions) frontmatter (**required**)
* Determines in which the versions the page is available. See [contributing/permalinks](../contributing/permalinks.md) for more info.
* Liquid statements in content (**optional**)
* Conditionally render content depending on the current version being viewed. See [contributing/liquid-helpers](../contributing/liquid-helpers.md) for more info. Note Liquid conditionals can also appear in `data` and `include` files.

## 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`
When 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 the article's [`title`](#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`](#allowtitletodifferfromfilename) frontmatter.

## Whitespace control

Expand All @@ -258,39 +202,39 @@ These characters are especially important in [index pages](#index-pages) compris

## 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).
Local links must start with a product ID (like `/actions` or `/admin`), and image paths must start with `/assets`. These links undergo some transformations on the server side to match the current page's language and version. 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
/github/writing-on-github/creating-a-saved-reply
```
When viewed on Dotcom, the link gets rendered with the language code:
When viewed on GitHub.com docs, the link gets rendered with the language code and version:
```
/en/articles/creating-a-saved-reply
/en/free-pro-team@latest/github/writing-on-github/creating-a-saved-reply
```
and when viewed on GHE, the version is included as well:
and when viewed on GitHub Enterprise Server docs, the version is included as well:
```
/en/enterprise/2.16/user/articles/creating-a-saved-reply
/en/enterprise-server@2.20/github/writing-on-github/creating-a-saved-reply
```

The transformation is a little simpler for image paths. If you include the following image path in a content file:
The transformation is a little different 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:
when viewed on GitHub Enterprise Server docs, the path gets rewritten to include S3:

```
https://github-images.s3.amazonaws.com/enterprise/2.16/assets/images/help/profile/follow-user-button.png
https://github-images.s3.amazonaws.com/enterprise/2.20/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>
<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 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.
Sometimes the canonical home of content moves outside the docs site. None of the links included in [`lib/redirects/external-redirects.json`](lib/redirects/external-redirects.json) get rewritten. See [`contributing/redirects.md`](contributing/redirects.md) for more info about this type of redirect.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ _Search_
{% if currentVersion == "free-pro-team@latest" %}
- [`DELETE /repos/:owner/:repo/vulnerability-alerts`](/v3/repos/#disable-vulnerability-alerts) (:write)
{% endif %}
- [`POST /user/repos`](/v3/repos/#create-a-repository-for-the-authenticated-user) (:write)
- [`PATCH /user/repository_invitations/:invitation_id`](/v3/repos/invitations/#accept-a-repository-invitation) (:write)
- [`DELETE /user/repository_invitations/:invitation_id`](/v3/repos/invitations/#decline-a-repository-invitation) (:write)

Expand Down
26 changes: 2 additions & 24 deletions contributing/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 v12** to run the site. If you're using [`nodenv`](https://github.com/nodenv/nodenv), read the [`nodenv` docs](#nodenv) below for instructions on switching to Node.js 12. 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 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).

Once you've installed Node.js (which includes the popular `npm` package manager), open Terminal and run the following:

Expand Down Expand Up @@ -52,26 +52,4 @@ For more info about working with this site, check out these READMEs:
- [middleware/README.md](../middleware/README.md)
- [script/README.md](../script/README.md)
- [stylesheets/README.md](../stylesheets/README.md)
- [tests/README.md](../tests/README.md)

## `nodenv`

[nodenv](https://github.com/nodenv/nodenv) is a tool for managing multiple Node.js versions on your local machine. It is **not required** to run this app, but you may already have it installed if you've worked on other projects that use Node.js.

To install Node.js 12 and make it your default version, run this command:

```sh
nodenv install 12.8.0 && nodenv global 12.8.0
```

You may sometimes see a warning when running npm scripts with nodenv:

```sh
npm WARN lifecycle The node binary used for scripts is [...] but npm is using [...]
```

This is due to nodenv's overriding behavior. To silence this harmless warning, the [nodenv docs](https://github.com/nodenv/nodenv/wiki/FAQ#npm-warning-about-mismatched-binaries) recommend running the following command from any directory:

```sh
npm config set scripts-prepend-node-path auto
```
- [tests/README.md](../tests/README.md)
Loading

0 comments on commit 5654ab4

Please sign in to comment.