Fix a few bugs in the boilerplate shortcode. (#3652)

This commit is contained in:
Martin Taillefer 2019-03-12 09:56:52 -07:00 committed by GitHub
parent a61fae859c
commit 0a07eed302
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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 -}}