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 15, 2024
1 parent 5fe3d8d commit add8b37
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 add8b37

Please sign in to comment.