resources/integrity: Return string instead of template.HTMLAttr

Closes #11513
This commit is contained in:
Joe Mooring
2023-09-29 09:22:58 -07:00
committed by Bjørn Erik Pedersen
parent 3af8bded26
commit 4c95389c25
2 changed files with 3 additions and 5 deletions

View File

@@ -21,7 +21,6 @@ import (
"encoding/hex"
"fmt"
"hash"
"html/template"
"io"
"github.com/gohugoio/hugo/resources/internal"
@@ -109,9 +108,9 @@ func (c *Client) Fingerprint(res resources.ResourceTransformer, algo string) (re
return res.Transform(&fingerprintTransformation{algo: algo})
}
func integrity(algo string, sum []byte) template.HTMLAttr {
func integrity(algo string, sum []byte) string {
encoded := base64.StdEncoding.EncodeToString(sum)
return template.HTMLAttr(algo + "-" + encoded)
return algo + "-" + encoded
}
func digest(h hash.Hash) ([]byte, error) {