From 642aa63a9cfdec70e766fd6c98965156c429cd1d Mon Sep 17 00:00:00 2001 From: George Lesica Date: Mon, 8 May 2017 10:32:14 -0600 Subject: [PATCH] markdown: Support Include arguments for Markdown. (#1653) Previously, the `Include` override used with the markdown plugin did not provide the optional `args` parameter. This made it impossible to pass arguments to a template used with that plugin. --- caddyhttp/markdown/template.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/caddyhttp/markdown/template.go b/caddyhttp/markdown/template.go index 524c9fe94..639f06fed 100644 --- a/caddyhttp/markdown/template.go +++ b/caddyhttp/markdown/template.go @@ -22,7 +22,8 @@ type Data struct { // Include "overrides" the embedded httpserver.Context's Include() // method so that included files have access to d's fields. // Note: using {{template 'template-name' .}} instead might be better. -func (d Data) Include(filename string) (string, error) { +func (d Data) Include(filename string, args ...interface{}) (string, error) { + d.Args = args return httpserver.ContextInclude(filename, d, d.Root) }