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: contributing/liquid-helpers.md
+16-18
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,19 @@ Note: If you are an open source contributor, you should not worry about versioni
8
8
9
9
## Versioned documentation
10
10
11
-
We provide versioned documentation for users of GitHub.com, Enterprise Server, and GitHub AE (with more to come). If multiple versions of a Docs site page exist, readers can choose the version from the version picker at the top of the page.
11
+
We provide versioned documentation for users of GitHub.com plans and Enterprise Cloud, Enterprise Server, and GitHub AE. If multiple versions of a page exist on the site, readers can choose the version from the version picker at the top of the page.
12
12
13
-
### Dotcom
13
+
### GitHub.com
14
14
15
-
Documentation for Dotcom has one version: the `free-pro-team@latest` version. The short name is `fpt`.
15
+
Documentation for GitHub.com has two possible versions:
16
+
17
+
#### Free, Pro, or Team plans
18
+
19
+
For Free, Pro, or Team plans on GitHub.com, use `free-pro-team@latest`. The short name is `fpt`.
20
+
21
+
#### Enterprise Cloud
22
+
23
+
For GitHub Enterprise Cloud, use `enterprise-cloud@latest`. The short name is `ghec`.
16
24
17
25
### Enterprise Server
18
26
@@ -22,7 +30,7 @@ The versions are named `enterprise-server@<release>`. The short name is `ghes`.
22
30
23
31
### GitHub AE
24
32
25
-
Documentation for GitHub AE is similar to Dotcom: we only offer one version of the content for the product, the `github-ae@latest` version. The short name is `ghae`.
33
+
Versioning for GitHub AE uses the `github-ae@latest` version. The short name is `ghae`.
26
34
27
35
## Versioning in the YAML frontmatter
28
36
@@ -34,7 +42,8 @@ If you define multiple products in the `versions` key within a page's YAML front
34
42
35
43
Important notes:
36
44
37
-
* Make sure to use `ifversion` and not `if`. A test will fail if an `if` statement is used for versioning.
45
+
* Use `ifversion` for product-based versioning. If you use `if` for product-based versioning, a test will fail.
46
+
* Use `if` for [feature-based versioning](#feature-based-versioning).
38
47
* Make sure to use `elsif` and not `else if`. Liquid does not recognize `else if` and will not render content inside an `else if` block.
39
48
40
49
### Comparison operators
@@ -74,17 +83,6 @@ When **at least one** operand must be true for the condition to be true, use the
74
83
75
84
Do **not** use the operators `&&` or `||`. Liquid does not recognize them, and the content will not render in the intended versions.
76
85
77
-
### Versioning content for _future_ releases of GitHub AE
78
-
79
-
If your content describes a feature that will be included in the next release of GitHub AE, you can use a placeholder version string, `ghae-next`. Before the next GitHub AE release, we will run a script to replace the placeholder with `ghae`.
80
-
81
-
For example, you can use this logic for a feature that's shipping on GitHub.com and will also be available in a future update to GitHub AE:
82
-
```
83
-
{% ifversion fpt or ghae-next %}This is a brand new feature, the likes of which have never been seen at this company before!{% endif %}
84
-
```
85
-
After the feature becomes available in GitHub AE and we run the replacement script, this statement will become:
86
-
```
87
-
{% ifversion fpt or ghae %}This is a brand new feature, the likes of which have never been seen at this company before!{% endif %}
88
-
```
86
+
### Feature-based versioning
89
87
90
-
`ifversion` tags can also support `ghae-issue-<number>` as an additional way to version content more granularly for upcoming GitHub AE releases.
88
+
You can define an arbitrarily named feature and associate specific product versions with that named feature using feature-based versioning. When you use the named version in a Liquid conditional block, the versions that you associate will apply to the content within the block. If the versioning for the feature changes, you can update one file instead of every individual Liquid tag.. For more information, see [data/features/README.md](/data/features).
Copy file name to clipboardExpand all lines: data/README.md
+10-2
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,13 @@ This directory contains data files that are parsed and made available to pages i
4
4
5
5
All YML and Markdown files in this directory are configured to be translated on Crowdin by default.
6
6
7
+
## Features
8
+
9
+
Feature files are used for feature-based versioning. See [features/README.md](features/README.md).
10
+
7
11
## Glossaries
8
12
9
-
Glossary files are used by our Crowdin integration. See [glossaries/README.md](glossaries/README.md).
13
+
We provide a customer-facing glossary on the site. Other glossary files are used by our Crowdin integration. See [glossaries/README.md](glossaries/README.md).
10
14
11
15
## GraphQL
12
16
@@ -30,4 +34,8 @@ Webhook payload JSON files are used in the [`webhook events docs`](../content/de
30
34
31
35
## Learning Tracks
32
36
33
-
Learning tracks are a collection of articles that help you master a particular subject. See [learning-tracks/README.md](learning-tracks/README.md).
37
+
Learning tracks are a collection of articles that help you master a particular subject. See [learning-tracks/README.md](learning-tracks/README.md).
38
+
39
+
## Versioning
40
+
41
+
Many YAML files in this directory's subdirectories, like [features](features), [glossaries](glossaries), [variables](variables), and [learning tracks](learning-tracks), as well as Markdown files within the [reusables](reusables) directory, can include YAML versioning or Liquid versioning within Markdown strings. See the README.md files in the subdirectories for details.
* Strings within `external.yml` support Liquid conditionals. See [contributing/liquid-helpers.md](/contributing/liquid-helpers.md).
6
7
*`internal.yml` contains entries used by translators only. These terms are displayed in the Crowdin UI to give translators additional context about what they're translating, plus a suggested localized string for that term.
7
8
*`candidates.yml` contains terms that should potentially be in either the internal or external glossary but haven't been defined yet.
Copy file name to clipboardExpand all lines: data/learning-tracks/README.md
+5-1
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,10 @@ Versioning for learning tracks is processed at page render time. The code lives
33
33
34
34
Liquid conditionals do **not** have to be used for versioning in the YAML file for guides. Only the learning track guides that apply to the current version will be rendered automatically. If there aren't any tracks with guides that belong to the current version, the learning tracks section will not render at all.
35
35
36
-
Explicit versioning within a product's learning tracks YML data is supported as well. For example:
36
+
Explicit versioning within a product's learning tracks YML data is supported as well. The format and allowed values are the same as the [frontmatter versions property](/content#versions).
37
+
38
+
For example:
39
+
37
40
```
38
41
learning_track_name:
39
42
title: 'Learning track title'
@@ -45,6 +48,7 @@ learning_track_name:
45
48
- /path/to/guide1
46
49
- /path/to/guide2
47
50
```
51
+
48
52
If the `versions` property is not included, it's assumed the track is available in all versions.
Copy file name to clipboardExpand all lines: data/reusables/README.md
+4
Original file line number
Diff line number
Diff line change
@@ -11,3 +11,7 @@ The *path* and *filename* of each Markdown file determines what its path will be
11
11
For example, a file named `/data/reusables/foo/bar.md` will be accessible as `{% data reusables.foo.bar %}` in pages.
12
12
13
13
Reusable files are divided generally into directories by task. For example, if you're creating a reusable string for articles about GitHub notifications, you'd add it in the directory `data/reusables/notifications/` in a file named `data/reusables/notifications/your-reusable-name.md`. The content reference you'd add to the source would look like `{% data reusables.notifications.your-reusable-name %}`.
14
+
15
+
## Versioning
16
+
17
+
Reusables can include Liquid conditionals to conditionally render content depending on the current version being viewed. See [contributing/liquid-helpers.md](/contributing/liquid-helpers.md).
0 commit comments