remove unused style hashing code
1 file changed, 0 insertions(+), 33 deletions(-)
changed files
M domain/content/builder/template/template.go → domain/content/builder/template/template.go
@@ -7,23 +7,14 @@ "io" "io/fs" "text/template" - "github.com/PuerkitoBio/goquery" "github.com/Southclaws/fault" "github.com/Southclaws/fault/fmsg" - "github.com/antchfx/xmlquery" - "github.com/antchfx/xpath" "alin.ovh/homestead/domain/content" "alin.ovh/homestead/domain/indieweb/atom" "alin.ovh/homestead/domain/web/templates" "alin.ovh/homestead/shared/config" ) - -var 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", -} func RenderRobotsTXT(baseURL config.URL, w io.Writer) error { tpl, err := template.ParseFS(templates.Files, "robots.tmpl")@@ -110,27 +101,3 @@ } return nil } - -func GetFeedStyleHash(r io.Reader) (string, error) { - doc, err := xmlquery.Parse(r) - if err != nil { - return "", fault.Wrap(err) - } - expr, err := xpath.CompileWithNS("//xhtml:style", nsMap) - if err != nil { - return "", fault.Wrap(err, fmsg.With("could not parse XPath")) - } - style := xmlquery.QuerySelector(doc, expr) - - return Hash(style.InnerText()), nil -} - -func GetHTMLStyleHash(r io.Reader) (string, error) { - doc, err := goquery.NewDocumentFromReader(r) - if err != nil { - return "", fault.Wrap(err) - } - html := doc.Find("head > style").Text() - - return Hash(html), nil -}