mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-23 18:55:49 +03: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"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -104,7 +106,7 @@ func generateStaticHTML(md Markdown, cfg *Config) error {
|
||||||
reqPath = "/" + reqPath
|
reqPath = "/" + reqPath
|
||||||
|
|
||||||
// Generate the static file
|
// 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)
|
_, err = md.Process(cfg, reqPath, body, ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue