diff options
Diffstat (limited to 'internal/builder/template.go')
-rw-r--r-- | internal/builder/template.go | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/internal/builder/template.go b/internal/builder/template.go index 5ec963a..9d81582 100644 --- a/internal/builder/template.go +++ b/internal/builder/template.go @@ -10,14 +10,11 @@ import ( "website/internal/atom" "website/internal/config" "website/internal/content" - "website/internal/log" "github.com/PuerkitoBio/goquery" - "github.com/a-h/htmlformat" "github.com/antchfx/xmlquery" "github.com/antchfx/xpath" "github.com/pkg/errors" - "golang.org/x/net/html" ) var ( @@ -84,6 +81,7 @@ func renderRobotsTXT(config config.Config) (io.Reader, error) { } w.Close() }() + return r, nil } @@ -209,27 +207,6 @@ func getHTMLStyleHash(filenames ...string) (string, error) { return "", err } html := doc.Find("head > style").Text() - return hash(html), nil -} - -func renderHTML(doc *goquery.Document) io.Reader { - r, w := io.Pipe() - - go func() { - _, err := w.Write([]byte("<!doctype html>\n")) - if err != nil { - log.Error("error writing doctype", "error", err) - w.CloseWithError(err) - } - err = htmlformat.Nodes(w, []*html.Node{doc.Children().Get(0)}) - if err != nil { - log.Error("error rendering html", "error", err) - w.CloseWithError(err) - return - } - defer w.Close() - }() - - return r + return hash(html), nil } |