mirror of https://github.com/istio/istio.io.git
Fix a few bugs in the boilerplate shortcode. (#3652)
This commit is contained in:
parent
a61fae859c
commit
0a07eed302
|
|
@ -1,4 +1,4 @@
|
||||||
{{/* This will try to find a resource in the "boilerplates" top-level content directory */}}
|
{{- /* This will try to find a resource in the "boilerplates" top-level content directory */ -}}
|
||||||
{{- $name := .Get 0 -}}
|
{{- $name := .Get 0 -}}
|
||||||
{{- $position := .Position }}
|
{{- $position := .Position }}
|
||||||
{{- if $name -}}
|
{{- if $name -}}
|
||||||
|
|
@ -13,13 +13,13 @@
|
||||||
{{- $path := path.Join $.Page.Dir $name -}}
|
{{- $path := path.Join $.Page.Dir $name -}}
|
||||||
{{- $page := $.Page.Site.GetPage "page" $path -}}
|
{{- $page := $.Page.Site.GetPage "page" $path -}}
|
||||||
{{- with $page }}
|
{{- with $page }}
|
||||||
{{ .Content }}
|
{{- .Content | safeHTML -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{ errorf "Could not find %s (%s)" $pattern $position }}
|
{{- errorf "Could not find %s (%s)" $pattern $position -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{ errorf "'boilerplates' direcory was not found (%s)" $position }}
|
{{- errorf "'boilerplates' direcory was not found (%s)" $position -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{- errorf "Missing name in boilerplate (%s)" $position -}}
|
{{- errorf "Missing name in boilerplate (%s)" $position -}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue