Skip to content

Commit

Permalink
Merge pull request #25 from xushiwei/app
Browse files Browse the repository at this point in the history
templ: use p.yapFS() to init
  • Loading branch information
xushiwei authored Jan 19, 2024
2 parents 9fad697 + 0eb3814 commit f811686
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion yap.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ func (p *Engine) Run(addr string, mws ...func(h http.Handler) http.Handler) erro
}

func (p *Engine) templ(path string) (t Template, err error) {
fsys := p.yapFS()
if p.tpls == nil {
return Template{}, os.ErrNotExist
}
t, ok := p.tpls[path]
if !ok {
t, err = ParseFSFile(p.fs, path+"_yap.html")
t, err = ParseFSFile(fsys, path+"_yap.html")
if err != nil {
return
}
Expand Down

0 comments on commit f811686

Please sign in to comment.