From 4d867e848bbc6d4ff65f3a4b840ad2349579adcb Mon Sep 17 00:00:00 2001 From: Abiola Ibrahim Date: Tue, 22 Dec 2015 13:32:27 +0100 Subject: [PATCH] Markdown: Fix panic on sitegen for request dependent template values. --- middleware/markdown/generator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/middleware/markdown/generator.go b/middleware/markdown/generator.go index d3485e91..653f457f 100644 --- a/middleware/markdown/generator.go +++ b/middleware/markdown/generator.go @@ -5,6 +5,8 @@ import ( "encoding/hex" "fmt" "io/ioutil" + "net/http" + "net/url" "os" "path/filepath" "strings" @@ -104,7 +106,7 @@ func generateStaticHTML(md Markdown, cfg *Config) error { reqPath = "/" + reqPath // Generate the static file - ctx := middleware.Context{Root: md.FileSys} + ctx := middleware.Context{Root: md.FileSys, Req: new(http.Request), URL: new(url.URL)} _, err = md.Process(cfg, reqPath, body, ctx) if err != nil { return err