Conditional Text

Docsy conditional-text shortcode for environment-specific content.

The conditional-text shortcode renders content only when the include-if value matches the site’s params.buildCondition. This is useful for showing content specific to certain build environments or feature flags.

{{< conditional-text include-if="examples" >}}
This text only appears when buildCondition is set to "examples".
{{< /conditional-text >}}

Parameters:

ParameterDescriptionDefault
include-ifCondition string to match against params.buildCondition(required)

Example:

This sentence is rendered because `params.buildCondition` is set to `examples`.

If the text above is not visible, the site’s params.buildCondition does not match "examples".