[How we docs] YAML frontmatter article (#40428)
Co-authored-by: Ethan Palm <56270045+ethanpalm@users.noreply.github.com> Co-authored-by: Steve Guntrip <stevecat@github.com>
This commit is contained in:
@@ -156,6 +156,38 @@ When at least one operand must be true for the condition to be true, use the ope
|
||||
|
||||
Do not use the operators `&&` or `||`. Liquid does not recognize them, and the content will not render in the intended versions.
|
||||
|
||||
### Whitespace control
|
||||
|
||||
When using Liquid conditionals in lists or tables, you can use [whitespace control](https://shopify.github.io/liquid/basics/whitespace/) characters to prevent the addition of newlines and other whitespace that would break the list or table rendering.
|
||||
|
||||
You can add a hyphen (`-`) on either the left, right, or both sides to indicate that there should be no newline or other whitespace on that side.
|
||||
|
||||
```
|
||||
{% raw %}{%- ifversion fpt %}{% endraw %}
|
||||
```
|
||||
|
||||
For example, to version a table row, instead of adding liquid versioning for the row starting at the end of the previous row, like this:
|
||||
|
||||
```
|
||||
Column A | Column B | Column C
|
||||
---------|----------|---------
|
||||
This row is for all versions | B1 | C1{% raw %}{% ifversion ghes %}{% endraw %}
|
||||
This row is for GHES only | B2 | C2{% raw %}{% endif %}{% endraw %}
|
||||
This row is for all versions | B3 | C3
|
||||
```
|
||||
|
||||
You can include the liquid versioning on its own line and use whitespace control to strip the newline to the left of the liquid tag. This makes reading the source much easier, without breaking the rendering of the table:
|
||||
|
||||
```
|
||||
Column A | Column B | Column C
|
||||
---------|----------|---------
|
||||
This row is for all versions | B1 | C1
|
||||
{% raw %}{%- ifversion ghes %}{% endraw %}
|
||||
This row is for GHES only | B2 | C2
|
||||
{% raw %}{%- endif %}{% endraw %}
|
||||
This row is for all versions | B3 | C3
|
||||
```
|
||||
|
||||
## About feature-based versioning
|
||||
|
||||
When you document any new change or feature, use feature-based versioning.
|
||||
|
||||
Reference in New Issue
Block a user