diff --git a/server.go b/server.go index 37f8f2b..012a6f9 100644 --- a/server.go +++ b/server.go @@ -105,7 +105,6 @@ func (s *Server) parseTemplates(t *template.Template, filenames ...string) (*tem } data := string(b) name := strings.TrimPrefix(filename, s.templates+"/") - log.Println("Template:", name) // First template becomes return value if not already defined, // and we use that one for subsequent New calls to associate @@ -183,7 +182,7 @@ func (s *Server) LoadTemplatesFS(fs http.FileSystem, base string) (*template.Tem func (s *Server) loadTemplates() *template.Template { tmpl, err := s.LoadTemplatesFS(s.fs, s.templates) if err != nil { - log.Fatal(err) + log.Fatal("loadTemplates", err, s.templates) } return tmpl @@ -290,6 +289,11 @@ func (s *Server) WithTheme(themeURL string) *Server { return s } +func (s *Server) WithRootFileSystem(fs http.FileSystem) *Server { + s.fs = fs + return s +} + func (s *Server) WithDebug(debugURL string) *Server { sub := s.router.PathPrefix(debugURL).Subrouter() setupDebugHandler(sub)