re-organise everything
1 file changed, 5 insertions(+), 6 deletions(-)
changed files
M internal/builder/template.go → internal/builder/template.go
@@ -5,7 +5,6 @@ "bytes" "encoding/xml" "io" "os" - "path/filepath" "strings" "text/template"@@ -28,8 +27,8 @@ "xhtml": "http://www.w3.org/1999/xhtml", } ) -func loadCSS(source string) { - bytes, err := os.ReadFile(filepath.Join(source, "templates/style.css")) +func loadCSS() { + bytes, err := os.ReadFile("templates/style.css") if err != nil { panic(err) }@@ -54,9 +53,9 @@ func (q *QueryDocument) Find(selector string) *QuerySelection { return &QuerySelection{q.Document.Find(selector)} } -func renderRobotsTXT(source string, config *config.Config) (io.Reader, error) { +func renderRobotsTXT(config *config.Config) (io.Reader, error) { r, w := io.Pipe() - tpl, err := template.ParseFiles(filepath.Join(source, "templates/robots.tmpl")) + tpl, err := template.ParseFiles("templates/robots.tmpl") if err != nil { return nil, err }@@ -119,7 +118,7 @@ return buf, nil } func renderFeedStyles(source string) (*strings.Reader, error) { - tpl, err := template.ParseFiles(filepath.Join(source, "templates/feed-styles.xsl")) + tpl, err := template.ParseFiles("templates/feed-styles.xsl") if err != nil { return nil, err }