summaryrefslogtreecommitdiffstats
path: root/hugolib/shortcode.go
diff options
context:
space:
mode:
Diffstat (limited to 'hugolib/shortcode.go')
-rw-r--r--hugolib/shortcode.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go
index cc8a145d9..56bf1ff9e 100644
--- a/hugolib/shortcode.go
+++ b/hugolib/shortcode.go
@@ -398,6 +398,10 @@ func doRenderShortcode(
return true
}
base, layoutDescriptor := po.GetInternalTemplateBasePathAndDescriptor()
+
+ // With shortcodes/mymarkdown.md (only), this allows {{% mymarkdown %}} when rendering HTML,
+ // but will not resolve any template when doing {{< mymarkdown >}}.
+ layoutDescriptor.AlwaysAllowPlainText = sc.doMarkup
q := tplimpl.TemplateQuery{
Path: base,
Name: sc.name,
@@ -405,10 +409,9 @@ func doRenderShortcode(
Desc: layoutDescriptor,
Consider: include,
}
- v := s.TemplateStore.LookupShortcode(q)
+ v, err := s.TemplateStore.LookupShortcode(q)
if v == nil {
- s.Log.Errorf("Unable to locate template for shortcode %q in page %q", sc.name, p.File().Path())
- return zeroShortcode, nil
+ return zeroShortcode, err
}
tmpl = v
hasVariants = hasVariants || len(ofCount) > 1