From f3e733ecbac53e599ca77cc71a1b429dcabf7649 Mon Sep 17 00:00:00 2001 From: Jim Angel Date: Mon, 11 May 2020 11:01:05 -0500 Subject: [PATCH] fix for feature state shortcode --- .../en/docs/templates/feature-state-alpha.txt | 8 ----- .../en/docs/templates/feature-state-beta.txt | 8 ----- .../templates/feature-state-deprecated.txt | 2 -- .../docs/templates/feature-state-stable.txt | 5 ---- content/en/docs/templates/index.md | 13 --------- .../partials/templates/feature-dialog.html | 29 ------------------- layouts/partials/templates/feature-state.html | 21 -------------- layouts/shortcodes/feature-state.html | 9 +++--- 8 files changed, 5 insertions(+), 90 deletions(-) delete mode 100644 content/en/docs/templates/feature-state-alpha.txt delete mode 100644 content/en/docs/templates/feature-state-beta.txt delete mode 100644 content/en/docs/templates/feature-state-deprecated.txt delete mode 100644 content/en/docs/templates/feature-state-stable.txt delete mode 100644 content/en/docs/templates/index.md delete mode 100644 layouts/partials/templates/feature-dialog.html delete mode 100644 layouts/partials/templates/feature-state.html diff --git a/content/en/docs/templates/feature-state-alpha.txt b/content/en/docs/templates/feature-state-alpha.txt deleted file mode 100644 index 24b28a7e92..0000000000 --- a/content/en/docs/templates/feature-state-alpha.txt +++ /dev/null @@ -1,8 +0,0 @@ -This feature is currently in a *alpha* state, meaning: - -* The version names contain alpha (e.g. v1alpha1). -* Might be buggy. Enabling the feature may expose bugs. Disabled by default. -* Support for feature may be dropped at any time without notice. -* The API may change in incompatible ways in a later software release without notice. -* Recommended for use only in short-lived testing clusters, due to increased risk of bugs and lack of long-term support. - diff --git a/content/en/docs/templates/feature-state-beta.txt b/content/en/docs/templates/feature-state-beta.txt deleted file mode 100644 index 25bd7ca729..0000000000 --- a/content/en/docs/templates/feature-state-beta.txt +++ /dev/null @@ -1,8 +0,0 @@ -This feature is currently in a *beta* state, meaning: - -* The version names contain beta (e.g. v2beta3). -* Code is well tested. Enabling the feature is considered safe. Enabled by default. -* Support for the overall feature will not be dropped, though details may change. -* The schema and/or semantics of objects may change in incompatible ways in a subsequent beta or stable release. When this happens, we will provide instructions for migrating to the next version. This may require deleting, editing, and re-creating API objects. The editing process may require some thought. This may require downtime for applications that rely on the feature. -* Recommended for only non-business-critical uses because of potential for incompatible changes in subsequent releases. If you have multiple clusters that can be upgraded independently, you may be able to relax this restriction. -* **Please do try our beta features and give feedback on them! After they exit beta, it may not be practical for us to make more changes.** diff --git a/content/en/docs/templates/feature-state-deprecated.txt b/content/en/docs/templates/feature-state-deprecated.txt deleted file mode 100644 index f2a38e44bb..0000000000 --- a/content/en/docs/templates/feature-state-deprecated.txt +++ /dev/null @@ -1,2 +0,0 @@ - -This feature is *deprecated*. For more information on this state, see the [Kubernetes Deprecation Policy](/docs/reference/deprecation-policy/). diff --git a/content/en/docs/templates/feature-state-stable.txt b/content/en/docs/templates/feature-state-stable.txt deleted file mode 100644 index 6d6d580c5c..0000000000 --- a/content/en/docs/templates/feature-state-stable.txt +++ /dev/null @@ -1,5 +0,0 @@ - -This feature is *stable*, meaning: - -* The version name is vX where X is an integer. -* Stable versions of features will appear in released software for many subsequent versions. diff --git a/content/en/docs/templates/index.md b/content/en/docs/templates/index.md deleted file mode 100644 index 9d7bccd143..0000000000 --- a/content/en/docs/templates/index.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -headless: true - -resources: -- src: "*alpha*" - title: "alpha" -- src: "*beta*" - title: "beta" -- src: "*deprecated*" - title: "deprecated" -- src: "*stable*" - title: "stable" ---- diff --git a/layouts/partials/templates/feature-dialog.html b/layouts/partials/templates/feature-dialog.html deleted file mode 100644 index 2f25aefb02..0000000000 --- a/layouts/partials/templates/feature-dialog.html +++ /dev/null @@ -1,29 +0,0 @@ - -{{ .page.Title }} -
-{{ .page.Content | markdownify }} -
- diff --git a/layouts/partials/templates/feature-state.html b/layouts/partials/templates/feature-state.html deleted file mode 100644 index 2076b0f078..0000000000 --- a/layouts/partials/templates/feature-state.html +++ /dev/null @@ -1,21 +0,0 @@ -
-{{ $for_k8s_version := .for_k8s_version | default (.page.Param "version") }} -{{ $width := .width | default "600" }} -{{ $state := .state }} -FEATURE STATE: Kubernetes {{ $for_k8s_version }} -{{/* docs/templates is a Hugo page bundle */}} -{{ $templates_path := "docs/templates" }} -{{ $templates := site.GetPage "page" $templates_path }} -{{ with $templates.Resources }} - {{ $template_path := printf "**feature-state-%s*" $state }} - {{ $content_template := .GetMatch $template_path }} - {{ with $content_template }} - {{ $dialog := dict "page" $content_template "for_k8s_version" $for_k8s_version "width" $width }} - {{ partial "templates/feature-dialog.html" $dialog }} - {{ else }} - {{ errorf "[%s] template not found in %s" site.Language.Lang $template_path }} - {{ end }} -{{ else }} - {{ errorf "[%s] templates not found in docs/templates" site.Language.Lang }} -{{ end }} -
diff --git a/layouts/shortcodes/feature-state.html b/layouts/shortcodes/feature-state.html index 17f278b1f6..745c5f396e 100644 --- a/layouts/shortcodes/feature-state.html +++ b/layouts/shortcodes/feature-state.html @@ -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 }} +
+FEATURE STATE: Kubernetes {{ $for_k8s_version }} [{{ $state }}] +
+{{ end }} \ No newline at end of file