mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Add generator kustomization references (#5447)
* Initial configMapGenerator ref * Draft configMapGenerator options * ConfigMapArgs * Add sources * Begin to restructure generator spec * Add ObjectMeta * Draft kustomization.md * Draft kustomization file links * Move bases weight * Update generatorArgs link to commmon generatorOptions * Remove api/generators for now * Update generatorOptions * Add generatorArgs header * Add secretGenerator * Remove ObjectMeta for now * Draft generators * Fix secretGenerator * Cleanup * Add include shortcode, cleanup generators * Use common includes * Update object metadata description * spelling * Improve args description
This commit is contained in:
27
site/layouts/shortcodes/include.html
Normal file
27
site/layouts/shortcodes/include.html
Normal file
@@ -0,0 +1,27 @@
|
||||
{{/* This will try to find a resource in the "includes" bundle */}}
|
||||
{{- $name := .Get 0 -}}
|
||||
{{- if $name -}}
|
||||
{{- $bundle := site.GetPage "page" "includes" -}}
|
||||
{{- with $bundle -}}
|
||||
{{- $pattern := printf "%s*" $name -}}
|
||||
{{- range $bundle.Resources -}}
|
||||
{{- end -}}
|
||||
{{- $resource := $bundle.Resources.GetMatch $pattern -}}
|
||||
{{- with $resource -}}
|
||||
{{- .Content | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{/* It is not a resource in the includes bundle. Try to find the page relative to the current. */}}
|
||||
{{- $path := path.Join $.Page.File.Dir $name -}}
|
||||
{{- $page := site.GetPage "page" $path -}}
|
||||
{{- with $page }}
|
||||
{{ .Content }}
|
||||
{{- else -}}
|
||||
{{ errorf "[%s] no Resource or Page matching %q." $.Page.Lang ($pattern | safeHTML ) }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{ errorf "[%s] the 'includes' bundle was not found." $.Page.Lang }}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- errorf "[%s] missing resource name in include for page %q" $.Page.Lang $.Page.Path -}}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user