{{- $condition := lower $.Site.Params.buildCondition -}} {{- if ne $condition "" -}} {{- $include_if := lower (.Get "include-if") -}} {{- $exclude_if := lower (.Get "exclude-if") -}} {{- if and (in $include_if $condition) (in $exclude_if $condition) -}} {{- errorf "Build condition %q appears in both include-if and exclude-if parameters of conditional-txt shortcode on page %s" $condition .Position -}} {{- end -}} {{- if isset $.Params "include-if" -}} {{- if in $include_if $condition -}} {{- .Inner -}} {{- else -}} {{- end -}} {{- else -}} {{- if isset $.Params "exclude-if" -}} {{- if in $exclude_if $condition -}} {{- else -}} {{- .Inner -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}}