Skip to content

Commit 271c82e

Browse files
authored
Merge pull request #115 from github/repo-sync
repo sync
2 parents cf5388a + 0a44768 commit 271c82e

File tree

4 files changed

+72
-137
lines changed

4 files changed

+72
-137
lines changed

content/README.md

Lines changed: 36 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

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

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

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

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

41-
### `productVersions`
41+
### `versions`
4242

43-
- Purpose: Indicates the products and product versions to which a page applies.
43+
- Purpose: Indicates the [versions](../lib/all-versions.js) to which a page applies.
4444
See [Versioning](#versioning) for more info.
45-
- Type: `Object`. Allowable keys map to product names and can be found in the `productVersions` object in [`lib/frontmatter.js`](../lib/frontmatter.js).
45+
- Type: `Object`. Allowable keys map to product names and can be found in the `versions` object in [`lib/frontmatter.js`](../lib/frontmatter.js).
4646
- This frontmatter value is currently **required** for all pages.
47+
- The `*` is used to denote all releases for the version.
4748

48-
Example that applies to GitHub.com and recent versions of GitHub Enterprise:
49+
Example that applies to GitHub.com and recent versions of GitHub Enterprise Server:
4950

5051
```yml
5152
title: About your personal dashboard
52-
productVersions:
53-
dotcom: '*'
54-
enterprise: '>=2.14'
53+
versions:
54+
free-pro-team: '*'
55+
enterprise-server: '>=2.20'
5556
```
5657
57-
Example that applies to all supported versions of GitHub enterprise
58+
Example that applies to all supported versions of GitHub Enterprise Server:
5859
(but not GitHub.com):
5960
6061
```yml
6162
title: Downloading your license
62-
productVersions:
63-
enterprise: '*'
63+
versions:
64+
enterprise-server: '*'
6465
```
6566
66-
Example that applies to GitHub Actions:
67-
68-
```yml
69-
title: Building actions
70-
productVersions:
71-
actions: '*'
72-
```
73-
74-
Note: Every product except `enterprise` is an evergreen product without specific versions, so the `*` is used to denote all versions.
75-
7667
### `redirect_from`
7768

7869
- Purpose: List URLs that should redirect to this page.
79-
- Type: `Array` (for multiple redirects) or `String` (for just one)
70+
- Type: `Array`
8071
- Optional
8172

82-
Example with multiple redirects:
73+
Example:
8374

8475
```yml
8576
title: Getting started with GitHub Desktop
@@ -89,14 +80,7 @@ redirect_from:
8980
- /articles/getting-started-with-github-for-windows/
9081
```
9182

92-
Example with a single redirect:
93-
94-
```yml
95-
title: Denying access to a previously approved OAuth App for your organization
96-
redirect_from: /articles/denying-access-to-a-previously-approved-application-for-your-organization/
97-
```
98-
99-
See [README#redirects](../README.md#redirects) for more info.
83+
See [`contributing/redirects`](contributing/redirects.md) for more info.
10084

10185
### `title`
10286

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

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

11397
Example:
11498

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

165149
- Purpose: Indicates the maximum heading level to include in an article's mini TOC. See [Autogenerated mini TOCs](#autogenerated-mini-tocs) for more info.
166-
- 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.)
150+
- Type: `Number`. Default is `3`. Minimum is `2`. Maximum is `4`.
167151
- Optional.
168152

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

194178
## Versioning
195179

196-
Versioning for any content file lives in **two** places:
197-
198-
* The file's [`productVersions`](#productversions) frontmatter.
199-
* Liquid conditionals in the file's parent [index page](#index-pages).
200-
201-
For example, an article with this frontmatter:
202-
203-
```yml
204-
title: About your personal dashboard
205-
productVersions:
206-
dotcom: '*'
207-
enterprise: '>=2.14'
208-
```
209-
210-
should be referenced in the parent index page like this:
180+
A content file can have **two** types of versioning:
211181

212-
```
213-
{%- if page.version == 'dotcom' or page.version ver_gt "2.13" %}
214-
- About your personal dashboard
215-
{%- endif %}
216-
```
182+
* [`versions`](#versions) frontmatter (**required**)
183+
* Determines in which the versions the page is available. See [contributing/permalinks](../contributing/permalinks.md) for more info.
184+
* Liquid statements in content (**optional**)
185+
* 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.
217186

218187
## Filenames
219188

220-
The site automatically creates links to articles in index pages. For example, this block in `content/index.md`:
221-
222-
```
223-
## Bootcamp
224-
225-
- Set up git
226-
- Create a repo
227-
- Fork a repo
228-
- Be social
229-
```
230-
231-
renders with links to each article.
232-
233-
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:
234-
235-
```
236-
## Bootcamp
237-
238-
- Set up git
239-
- Create a repo
240-
- Fork a repo
241-
- Be social
242-
- I'm a new article
243-
```
244-
245-
Then just run the site locally and see what the link is. In this example, the filename would be: `im-a-new-article`
189+
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.
246190

247191
## Whitespace control
248192

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

259203
## Links and image paths
260204

261-
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).
205+
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).
262206

263207
For example, if you include the following link in a content file:
264208

265209
```
266-
/articles/creating-a-saved-reply
210+
/github/writing-on-github/creating-a-saved-reply
267211
```
268-
When viewed on Dotcom, the link gets rendered with the language code:
212+
When viewed on GitHub.com docs, the link gets rendered with the language code and version:
269213
```
270-
/en/articles/creating-a-saved-reply
214+
/en/free-pro-team@latest/github/writing-on-github/creating-a-saved-reply
271215
```
272-
and when viewed on GHE, the version is included as well:
216+
and when viewed on GitHub Enterprise Server docs, the version is included as well:
273217
```
274-
/en/enterprise/2.16/user/articles/creating-a-saved-reply
218+
/en/enterprise-server@2.20/github/writing-on-github/creating-a-saved-reply
275219
```
276220

277-
The transformation is a little simpler for image paths. If you include the following image path in a content file:
221+
The transformation is a little different for image paths. If you include the following image path in a content file:
278222

279223
```
280224
/assets/images/help/profile/follow-user-button.png
281225
```
282-
when viewed on GHE, the path gets rewritten to include S3:
226+
when viewed on GitHub Enterprise Server docs, the path gets rewritten to include S3:
283227

284228
```
285-
https://github-images.s3.amazonaws.com/enterprise/2.16/assets/images/help/profile/follow-user-button.png
229+
https://github-images.s3.amazonaws.com/enterprise/2.20/assets/images/help/profile/follow-user-button.png
286230
```
287231

288232
### Preventing transformations
289233

290234
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:
291235

292236
```
293-
<a href="/articles/github-terms-of-service/" class="dotcom-only">GitHub's Terms of Service</a>
237+
<a href="/github/site-policy/github-terms-of-service" class="dotcom-only">GitHub's Terms of Service</a>
294238
```
295239

296-
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.
240+
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.

contributing/liquid-helpers.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ Note: The below examples are only intended to show Liquid syntax and operators.
4545
In statements where **all** operands must be true for the condition to be true, use the operator `and`:
4646

4747
```
48-
{% if page.version != "dotcom" and page.version ver_gt "2.6" %}
48+
{% if currentVersion != "free-pro-team@latest" and currentVersion ver_gt "enterprise-server@2.21" %}
4949
```
5050

5151
In statements where **at least one** operand must be true for the condition to be true, use the operator `or`:
5252

5353
```
54-
{% if page.version == "dotcom" or page.version ver_gt "2.6" %}
54+
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}
5555
```
5656

5757
Do **not** use the operators `&&` or `||`. If you do, the content will not render in the intended versions. Only use `and` or `or`.
@@ -74,39 +74,39 @@ If your content is included in all versions of Enterprise, you need not include
7474
If your content only applies to GitHub.com, such as billing information, use this logic:
7575

7676
```
77-
{% if page.version == "dotcom" %}This is how you pay for your personal account, which is something you wouldn't do in Enterprise.{% endif %}
77+
{% if currentVersion == "free-pro-team@latest" %}This is how you pay for your personal account, which is something you wouldn't do in Enterprise.{% endif %}
7878
```
7979

8080
In this example:
81-
- `if page.version == "dotcom"` will include the content for Dotcom output and *only* Dotcom.
81+
- `if currentVersion == "free-pro-team@latest"` will include the content for Dotcom output and *only* Dotcom.
8282
- `{% endif %}` ends the statement.
8383

8484
#### Including content for *new Dotcom features* that will be included in Enterprise
8585

8686
If your content is describing a new feature that was added to GitHub.com and will be automatically included in the next release of GitHub Enterprise, use this logic:
8787

8888
```
89-
{% if page.version == "dotcom" or page.version ver_gt "2.6" %}This is a brand new feature, the likes of which have never been seen at this company before!{% endif %}
89+
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "enterprise-server@2.21" %}This is a brand new feature, the likes of which have never been seen at this company before!{% endif %}
9090
```
9191

9292
In this example:
9393

94-
- `if page.version == "dotcom"` will include the content for GitHub.com output.
95-
- `or page.version ver_gt "2.6"` will include the content for releases *after* Enterprise 2.6, which means the content will be included for 2.7+.
94+
- `if currentVersion == "free-pro-team@latest"` will include the content for GitHub.com output.
95+
- `or currentVersion ver_gt "enterprise-server@2.21"` will include the content for releases *after* Enterprise 2.21, which means the content will be included for 2.7+.
9696
- `{% endif %}` ends the statement.
9797

9898
#### Including content for *changed* Dotcom features that will also change in Enterprise
9999

100100
If your content is describing a change to existing functionality in Dotcom, such as changed UI text or a more simple means of completing a task, use this logic:
101101

102102
```
103-
{% if page.version == "dotcom" or page.version ver_gt "2.10" %}This is the new way of doing things {% else %}This is the old way of doing things {% endif %}
103+
{% if currentVersion == "free-pro-team@latest" or currentVersion ver_gt "2.20" %}This is the new way of doing things {% else %}This is the old way of doing things {% endif %}
104104
```
105105

106106
In this example:
107107

108-
- `if page.version == "dotcom"` will include the content for GitHub.com output.
109-
- `or page.version ver_gt "2.6"` will include the content for releases *after* Enterprise 2.6, which means the content will be included for 2.7+.
108+
- `if currentVersion == "free-pro-team@latest"` will include the content for GitHub.com output.
109+
- `or currentVersion ver_gt "enterprise-server@2.21"` will include the content for releases *after* Enterprise 2.21, which means the content will be included for 2.22+.
110110
- `{% else %}` means if the above is NOT true, then display the content that follows, `This is the old way of doing things`.
111111
- `{% endif %}` ends the statement.
112112

@@ -115,49 +115,50 @@ In this example:
115115
If your content is describing a change to existing functionality in Dotcom, and that functionality doesn't exist in all older Enterprise versions, use logic like this:
116116

117117
```
118-
{% if page.version == 'dotcom' or page.version ver_gt "2.10" %}
118+
{% if currentVersion == 'dotcom' or currentVersion ver_gt "2.20" %}
119119
120120
This is the new way of doing things.
121121
122-
{% elsif page.version ver_gt "2.8" and page.version ver_lt "2.11" %}
122+
{% endif %}
123+
{% if currentVersion ver_gt "enterprise-server@2.19" and currentVersion ver_lt "2.21" %}
123124
124-
This is the old way of doing things (which did not exist before 2.9).
125+
This is the old way of doing things (which did not exist before 2.20).
125126
126127
{% endif %}
127128
```
128129

129130
In this example:
130131

131-
- `if page.version == "dotcom"` will include the content for GitHub.com output.
132-
- `or page.version ver_gt "2.10"` will include the content for releases *after* Enterprise 2.10, which means the content will be included for 2.11+.
133-
- `elsif page.version ver_gt "2.8" and page.version ver_lt "2.11"` means if the above is NOT true, and the version is either 2.9 or 2.10, then display the content that follows, `This is the old way of doing things`. No content will be displayed for versions older than 2.9.
132+
- `if currentVersion == "free-pro-team@latest"` will include the content for GitHub.com output.
133+
- `or currentVersion ver_gt "2.20"` will include the content for releases *after* Enterprise 2.20, which means the content will be included for 2.21+.
134+
- `elsif currentVersion ver_gt "enterprise-server@2.19" and currentVersion ver_lt "2.21"` means if the above is NOT true, and the version is 2.20, then display the content that follows, `This is the old way of doing things`. No content will be displayed for versions older than 2.20.
134135
- `{% endif %}` ends the statement.
135136

136137
#### Including content for *new Enterprise features* that don't exist on Dotcom
137138

138139
If your content is describing a new feature that was added to GitHub Enterprise but not GitHub, such as LDAP support, use this logic:
139140

140141
```
141-
{% if page.version != "dotcom" and page.version ver_gt "2.6" %}This is a brand new feature, admin-type people!{% endif %}
142+
{% if currentVersion != "free-pro-team@latest" and currentVersion ver_gt "enterprise-server@2.21" %}This is a brand new feature, admin-type people!{% endif %}
142143
```
143144

144145
In this example:
145146

146-
- `if page.version != "dotcom"` will exclude the content for GitHub.com output.
147-
- `and page.version ver_gt "2.6"` will *additionally* include the content for releases *after* Enterprise 2.6, which means the content will be included for 2.7+.
147+
- `if currentVersion != "free-pro-team@latest"` will exclude the content for GitHub.com output.
148+
- `and currentVersion ver_gt "enterprise-server@2.21"` will *additionally* include the content for releases *after* Enterprise 2.21, which means the content will be included for 2.22+.
148149
- `{% endif %}` ends the statement.
149150

150151
#### Including content for *changed Enterprise features* that don't exist on Dotcom
151152

152153
If your content is describing a change to existing functionality in GitHub Enterprise, such as changed UI text or a more simple means of completing a task in the Management Console, use this logic:
153154

154155
```
155-
{% if page.version != "dotcom" and page.version ver_gt "2.6" %}This is the new way of doing things, admins! {% else %}This is the old way of doing things, admins! {% endif %}
156+
{% if currentVersion != "free-pro-team@latest" and currentVersion ver_gt "enterprise-server@2.21" %}This is the new way of doing things, admins! {% else %}This is the old way of doing things, admins! {% endif %}
156157
```
157158

158159
In this example:
159160

160-
- `if page.version != "dotcom"` will exclude the content for GitHub.com output.
161-
- `and page.version ver_gt "2.6"` will *additionally* include the content for releases *after* Enterprise 2.6, which means the content will be included for 2.7+.
161+
- `if currentVersion != "free-pro-team@latest"` will exclude the content for GitHub.com output.
162+
- `and currentVersion ver_gt "enterprise-server@2.21"` will *additionally* include the content for releases *after* Enterprise 2.21, which means the content will be included for 2.22+.
162163
- `{% else %}` means if the above is NOT true, then display the content that follows, `This is the old way of doing things, admins!`.
163164
- `{% endif %}` ends the statement.

contributing/permalinks.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Permalinks
22

3-
Because the site is dynamic, it does not build HTML files for each different version of an article. Instead it generates a "permalink" for every version of the article. It does this based on the article's [`productVersions` frontmatter](content#productversions).
3+
Because the site is dynamic, it does not build HTML files for each different version of an article. Instead it generates a "permalink" for every version of the article. It does this based on the article's [`versions` frontmatter](content#versions).
44

5-
For example, an article that is available in Dotcom and all Enterprise versions will have permalinks like the following:
5+
For example, an article that is available in currently supported versions will have permalink URLs like the following:
66

7-
* `/en/articles/set-up-git`
8-
* `/en/enterprise/2.16/user/articles/set-up-git`
9-
* `/en/enterprise/2.15/user/articles/set-up-git`
10-
* `/en/enterprise/2.14/user/articles/set-up-git`
11-
* `/en/enterprise/2.13/user/articles/set-up-git`
7+
* `/en/free-pro-team@latest/github/getting-started-with-github/set-up-git`
8+
* `/en/enterprise-server@2.22/github/getting-started-with-github/set-up-git`
9+
* `/en/enterprise-server@2.21/github/getting-started-with-github/set-up-git`
10+
* `/en/enterprise-server@2.20/github/getting-started-with-github/set-up-git`
11+
* `/en/enterprise-server@2.19/github/getting-started-with-github/set-up-git`
1212

13-
An article that is only available in Dotcom will have just one permalink:
13+
An article that is not available in Enterprise will have just one permalink:
1414

15-
* `/en/articles/githubs-billing-plans`
15+
* `/en/free-pro-team@latest/github/getting-started-with-github/set-up-git`

0 commit comments

Comments
 (0)