0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-13 22:51:08 -05:00

Markdown: Fix panic on sitegen for request dependent template values.

This commit is contained in:
Abiola Ibrahim 2015-12-22 13:32:27 +01:00
parent c748ef944b
commit 4d867e848b

View file

@ -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