Skip to content

Commit

Permalink
Warn on use of (deprecated) param shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
sftim committed May 12, 2024
1 parent b9083c7 commit 3c98451
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion layouts/shortcodes/param.html
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
{{- .Page.Param (.Get 0) -}}
{{- $name := (.Get 0) -}}
{{- with $name -}}
{{- with ($.Page.Param .) }}{{ . }}{{ else }}{{ errorf "Param %q not found: %s" $name $.Position }}{{ end -}}
{{- else }}{{ errorf "Missing param key: %s" $.Position }}{{ end -}}
{{- with $.Page.File.Filename -}}
{{- $warningText := slice
"Deprecated param shortcode detected."
"The Kubernetes website does not / should not use param shortcodes."
( printf "Check %q" ( replaceRE "^/src/" "" . ) ) -}}
{{- if and (eq $.Site.LanguagePrefix "") (ne $name "version" ) -}}
{{- warnf (delimit $warningText " " ) -}}
{{- end -}}
{{- end -}}

0 comments on commit 3c98451

Please sign in to comment.