all repos — website @ a2feb8c63c80a1f52830f562af2deb2c6065eaae

My website

move templ templates into separate package

Alan Pearce
commit

a2feb8c63c80a1f52830f562af2deb2c6065eaae

parent

8623948592fa14958d340b006653fc57861c4fc4

1 file changed, 6 insertions(+), 6 deletions(-)

changed files
M internal/builder/template.gointernal/builder/template.go
@@ -21,9 +21,9 @@ "golang.org/x/net/html"
) var ( - css string - templates = make(map[string]*os.File) - nsMap = map[string]string{ + css string + templateFiles = make(map[string]*os.File) + nsMap = map[string]string{ "xsl": "http://www.w3.org/1999/XSL/Transform", "atom": "http://www.w3.org/2005/Atom", "xhtml": "http://www.w3.org/1999/xhtml",
@@ -39,14 +39,14 @@ css = string(bytes)
} func loadTemplate(path string) (file *os.File, err error) { - if templates[path] == nil { + if templateFiles[path] == nil { file, err = os.OpenFile(path, os.O_RDONLY, 0) if err != nil { return nil, errors.Wrapf(err, "could not load template at path %s", path) } - templates[path] = file + templateFiles[path] = file } - file = templates[path] + file = templateFiles[path] return }