Commit 642aa63a authored by George Lesica's avatar George Lesica Committed by Matt Holt

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.
parent 90efff68
...@@ -22,7 +22,8 @@ type Data struct { ...@@ -22,7 +22,8 @@ type Data struct {
// Include "overrides" the embedded httpserver.Context's Include() // Include "overrides" the embedded httpserver.Context's Include()
// method so that included files have access to d's fields. // method so that included files have access to d's fields.
// Note: using {{template 'template-name' .}} instead might be better. // 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) return httpserver.ContextInclude(filename, d, d.Root)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment