fix for feature state shortcode
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
{{ $valid_states := "alpha, beta, deprecated, stable" }}
|
||||
{{ $state := .Get "state" }}
|
||||
{{ $for_k8s_version := .Get "for_k8s_version" }}
|
||||
{{ $width := .Get "width" }}
|
||||
{{ $for_k8s_version := .Get "for_k8s_version" | default (.Page.Param "version")}}
|
||||
{{ $is_valid := strings.Contains $valid_states $state }}
|
||||
{{ if not $is_valid }}
|
||||
{{ errorf "%q is not a valid feature-state, use one of %q" $valid_states }}
|
||||
{{ else }}
|
||||
{{ partial "templates/feature-state.html" (dict "ctx" . "page" .Page "state" $state "for_k8s_version" $for_k8s_version "width" $width) }}
|
||||
{{ end }}
|
||||
<div style="margin-top: 10px; margin-bottom: 10px;">
|
||||
<b>FEATURE STATE:</b> <code>Kubernetes {{ $for_k8s_version }} [{{ $state }}]</code>
|
||||
</div>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user