Skip to content

Markdown versions of all docs pages are available by appending .md to any docs URL.

version

Page as Markdown

Renders its body only on the versions the author names

Either call form works, and both produce identical HTML.

Parameters

NameTypeRequiredDefaultDescription
versionstringnoVersion string to import, for a self-closing call.
include-ifstringnoRender the body only on versions matching this token.
exclude-ifstringnoRender the body on every version EXCEPT those matching.

Example

{{% version include-if="v2" %}}
This paragraph appears only on v2 pages.
{{% /version %}}
Rendered output

Notes

include-if and exclude-if are read inside utils/gate-decide.html, the condition evaluator shared with conditional-text. They are documented here because a reader writing the call should not need to know that.

The bulk of the template is condition resolution: derive the current version from the URL, match it against params.versions, and handle the keepVersion landing zone. There is one emit site, utils/gate-emit.html, which emits .Inner untouched.

Interaction with rebase

The rebase pipeline remaps OSS version tokens to their enterprise equivalents through each params.versions entry’s ossVersion. A keepVersion block opts out of that remap. Getting the two confused is a known source of bugs: an enterprise token that collides with another entry’s ossVersion is the shape that once broke kgateway’s github-branch page.

A version block inside a numbered list must wrap the WHOLE list item, including its 1. marker. Wrapping only part of the item detaches the remainder from the list.


Source: layouts/_shortcodes/version.html

Was this page helpful?