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:
parent
c748ef944b
commit
4d867e848b
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue