diff options
author | Alan Pearce | 2024-06-24 21:48:36 +0200 |
---|---|---|
committer | Alan Pearce | 2024-06-24 23:09:15 +0200 |
commit | a2feb8c63c80a1f52830f562af2deb2c6065eaae (patch) | |
tree | 448ed15c5fb91099ef29528c529a35d6151d98ee /internal/builder/template.go | |
parent | 8623948592fa14958d340b006653fc57861c4fc4 (diff) | |
download | website-a2feb8c63c80a1f52830f562af2deb2c6065eaae.tar.lz website-a2feb8c63c80a1f52830f562af2deb2c6065eaae.tar.zst website-a2feb8c63c80a1f52830f562af2deb2c6065eaae.zip |
move templ templates into separate package
Diffstat (limited to 'internal/builder/template.go')
-rw-r--r-- | internal/builder/template.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/builder/template.go b/internal/builder/template.go index 53199fc..5ec963a 100644 --- a/internal/builder/template.go +++ b/internal/builder/template.go @@ -21,9 +21,9 @@ import ( ) 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 @@ func loadCSS() { } 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 } |