Use proper struct constructors instead.

This commit is contained in:
Abiola Ibrahim 2015-12-22 14:43:48 +01:00
parent 4d867e848b
commit 9e163a655d

View file

@ -105,8 +105,12 @@ func generateStaticHTML(md Markdown, cfg *Config) error {
reqPath = filepath.ToSlash(reqPath) reqPath = filepath.ToSlash(reqPath)
reqPath = "/" + reqPath reqPath = "/" + reqPath
// Create empty requests and url to cater for template values.
req, _ := http.NewRequest("", "/", nil)
urlVar, _ := url.Parse("/")
// Generate the static file // Generate the static file
ctx := middleware.Context{Root: md.FileSys, Req: new(http.Request), URL: new(url.URL)} ctx := middleware.Context{Root: md.FileSys, Req: req, URL: urlVar}
_, err = md.Process(cfg, reqPath, body, ctx) _, err = md.Process(cfg, reqPath, body, ctx)
if err != nil { if err != nil {
return err return err