From a2feb8c63c80a1f52830f562af2deb2c6065eaae Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Mon, 24 Jun 2024 21:48:36 +0200 Subject: move templ templates into separate package --- internal/builder/template.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'internal/builder/template.go') 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 } -- cgit 1.4.1