You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/README.md
+36-92Lines changed: 36 additions & 92 deletions
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,12 @@
2
2
3
3
The `/content` directory is where all the site's (English) Markdown content lives!
4
4
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.
6
6
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.
8
8
9
9
-[Frontmatter](#frontmatter)
10
-
-[`productVersions`](#productversions)
10
+
-[`versions`](#versions)
11
11
-[`redirect_from`](#redirect_from)
12
12
-[`title`](#title)
13
13
-[`shortTitle`](#shorttitle)
@@ -38,48 +38,39 @@ The following frontmatter values have special meanings and requirements for this
38
38
There's also a schema that's used by the test suite to validate every page's frontmatter.
39
39
See [`lib/frontmatter.js`](../lib/frontmatter.js).
40
40
41
-
### `productVersions`
41
+
### `versions`
42
42
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.
44
44
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).
46
46
- This frontmatter value is currently **required** for all pages.
47
+
- The `*` is used to denote all releases for the version.
47
48
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:
49
50
50
51
```yml
51
52
title: About your personal dashboard
52
-
productVersions:
53
-
dotcom: '*'
54
-
enterprise: '>=2.14'
53
+
versions:
54
+
free-pro-team: '*'
55
+
enterprise-server: '>=2.20'
55
56
```
56
57
57
-
Example that applies to all supported versions of GitHub enterprise
58
+
Example that applies to all supported versions of GitHub Enterprise Server:
58
59
(but not GitHub.com):
59
60
60
61
```yml
61
62
title: Downloading your license
62
-
productVersions:
63
-
enterprise: '*'
63
+
versions:
64
+
enterprise-server: '*'
64
65
```
65
66
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
-
76
67
### `redirect_from`
77
68
78
69
- Purpose: List URLs that should redirect to this page.
79
-
- Type: `Array`(for multiple redirects) or `String` (for just one)
See [README#redirects](../README.md#redirects) for more info.
83
+
See [`contributing/redirects`](contributing/redirects.md) for more info.
100
84
101
85
### `title`
102
86
@@ -108,7 +92,7 @@ See [README#redirects](../README.md#redirects) for more info.
108
92
109
93
- Purpose: An abbreviated variant of the page title for use in breadcrumbs.
110
94
- 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.
112
96
113
97
Example:
114
98
@@ -163,7 +147,7 @@ For a layout named `layouts/article.html`, the value would be `article`.
163
147
### `miniTocMaxHeadingLevel`
164
148
165
149
- 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`.
167
151
- Optional.
168
152
169
153
### `allowTitleToDifferFromFilename`
@@ -193,56 +177,16 @@ Make sure not to add hardcoded "In this article" sections in the Markdown source
193
177
194
178
## Versioning
195
179
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:
211
181
212
-
```
213
-
{%- if page.version == 'dotcom' or page.version ver_gt "2.13" %}
* 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.
217
186
218
187
## Filenames
219
188
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.
246
190
247
191
## Whitespace control
248
192
@@ -258,39 +202,39 @@ These characters are especially important in [index pages](#index-pages) compris
258
202
259
203
## Links and image paths
260
204
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).
262
206
263
207
For example, if you include the following link in a content file:
264
208
265
209
```
266
-
/articles/creating-a-saved-reply
210
+
/github/writing-on-github/creating-a-saved-reply
267
211
```
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:
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:
291
235
292
236
```
293
-
<ahref="/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>
294
238
```
295
239
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.
Copy file name to clipboardExpand all lines: contributing/liquid-helpers.md
+23-22Lines changed: 23 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -45,13 +45,13 @@ Note: The below examples are only intended to show Liquid syntax and operators.
45
45
In statements where **all** operands must be true for the condition to be true, use the operator `and`:
46
46
47
47
```
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" %}
49
49
```
50
50
51
51
In statements where **at least one** operand must be true for the condition to be true, use the operator `or`:
52
52
53
53
```
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" %}
55
55
```
56
56
57
57
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
74
74
If your content only applies to GitHub.com, such as billing information, use this logic:
75
75
76
76
```
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 %}
78
78
```
79
79
80
80
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.
82
82
-`{% endif %}` ends the statement.
83
83
84
84
#### Including content for *new Dotcom features* that will be included in Enterprise
85
85
86
86
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:
87
87
88
88
```
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 %}
90
90
```
91
91
92
92
In this example:
93
93
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+.
96
96
-`{% endif %}` ends the statement.
97
97
98
98
#### Including content for *changed* Dotcom features that will also change in Enterprise
99
99
100
100
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:
101
101
102
102
```
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 %}
104
104
```
105
105
106
106
In this example:
107
107
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+.
110
110
-`{% else %}` means if the above is NOT true, then display the content that follows, `This is the old way of doing things`.
111
111
-`{% endif %}` ends the statement.
112
112
@@ -115,49 +115,50 @@ In this example:
115
115
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:
116
116
117
117
```
118
-
{% if page.version == 'dotcom' or page.version ver_gt "2.10" %}
118
+
{% if currentVersion == 'dotcom' or currentVersion ver_gt "2.20" %}
119
119
120
120
This is the new way of doing things.
121
121
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" %}
123
124
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).
125
126
126
127
{% endif %}
127
128
```
128
129
129
130
In this example:
130
131
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.
134
135
-`{% endif %}` ends the statement.
135
136
136
137
#### Including content for *new Enterprise features* that don't exist on Dotcom
137
138
138
139
If your content is describing a new feature that was added to GitHub Enterprise but not GitHub, such as LDAP support, use this logic:
139
140
140
141
```
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 %}
142
143
```
143
144
144
145
In this example:
145
146
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+.
148
149
-`{% endif %}` ends the statement.
149
150
150
151
#### Including content for *changed Enterprise features* that don't exist on Dotcom
151
152
152
153
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:
153
154
154
155
```
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 %}
156
157
```
157
158
158
159
In this example:
159
160
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+.
162
163
-`{% else %}` means if the above is NOT true, then display the content that follows, `This is the old way of doing things, admins!`.
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).
4
4
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:
0 commit comments