Skip to content

Commit 763fff1

Browse files
authored
Update versioning guidance (github#23793)
1 parent 4c6ed5b commit 763fff1

File tree

5 files changed

+36
-21
lines changed

5 files changed

+36
-21
lines changed

contributing/liquid-helpers.md

+16-18
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,19 @@ Note: If you are an open source contributor, you should not worry about versioni
88

99
## Versioned documentation
1010

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.
1212

13-
### Dotcom
13+
### GitHub.com
1414

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`.
1624

1725
### Enterprise Server
1826

@@ -22,7 +30,7 @@ The versions are named `enterprise-server@<release>`. The short name is `ghes`.
2230

2331
### GitHub AE
2432

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`.
2634

2735
## Versioning in the YAML frontmatter
2836

@@ -34,7 +42,8 @@ If you define multiple products in the `versions` key within a page's YAML front
3442

3543
Important notes:
3644

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).
3847
* 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.
3948

4049
### Comparison operators
@@ -74,17 +83,6 @@ When **at least one** operand must be true for the condition to be true, use the
7483

7584
Do **not** use the operators `&&` or `||`. Liquid does not recognize them, and the content will not render in the intended versions.
7685

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
8987

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).

data/README.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ This directory contains data files that are parsed and made available to pages i
44

55
All YML and Markdown files in this directory are configured to be translated on Crowdin by default.
66

7+
## Features
8+
9+
Feature files are used for feature-based versioning. See [features/README.md](features/README.md).
10+
711
## Glossaries
812

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).
1014

1115
## GraphQL
1216

@@ -30,4 +34,8 @@ Webhook payload JSON files are used in the [`webhook events docs`](../content/de
3034

3135
## Learning Tracks
3236

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.

data/glossaries/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
The following files comprise our [Crowdin Glossary](https://support.crowdin.com/glossary/):
44

55
* `external.yml` contains customer-facing glossary entries.
6+
* Strings within `external.yml` support Liquid conditionals. See [contributing/liquid-helpers.md](/contributing/liquid-helpers.md).
67
* `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.
78
* `candidates.yml` contains terms that should potentially be in either the internal or external glossary but haven't been defined yet.

data/learning-tracks/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ Versioning for learning tracks is processed at page render time. The code lives
3333
3434
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.
3535
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+
3740
```
3841
learning_track_name:
3942
title: 'Learning track title'
@@ -45,6 +48,7 @@ learning_track_name:
4548
- /path/to/guide1
4649
- /path/to/guide2
4750
```
51+
4852
If the `versions` property is not included, it's assumed the track is available in all versions.
4953
5054
## Schema enforcement

data/reusables/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ The *path* and *filename* of each Markdown file determines what its path will be
1111
For example, a file named `/data/reusables/foo/bar.md` will be accessible as `{% data reusables.foo.bar %}` in pages.
1212

1313
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

Comments
 (0)