diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-09-23 23:40:35 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-09-23 23:40:35 +0200 |
commit | fe6a6f2737769070fd64a5192ff685c9c89020bd (patch) | |
tree | 0e83c056d5e5ade3cc97099a9b90eb037de47d0c | |
parent | 2650fa772b40846d9965f8c5f169286411f3beb2 (diff) |
resource/integrity: Make Data.Integrity be of type template.HTMLAttr
-rw-r--r-- | resource/integrity/integrity.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/resource/integrity/integrity.go b/resource/integrity/integrity.go index bd85a503a..bbb214170 100644 --- a/resource/integrity/integrity.go +++ b/resource/integrity/integrity.go @@ -21,6 +21,7 @@ import ( "encoding/hex" "fmt" "hash" + "html/template" "io" "github.com/gohugoio/hugo/resource" @@ -93,10 +94,9 @@ func (c *Client) Fingerprint(res resource.Resource, algo string) (resource.Resou ) } -func integrity(algo string, sum []byte) string { +func integrity(algo string, sum []byte) template.HTMLAttr { encoded := base64.StdEncoding.EncodeToString(sum) - return fmt.Sprintf("%s-%s", algo, encoded) - + return template.HTMLAttr(fmt.Sprintf("%s-%s", algo, encoded)) } func digest(h hash.Hash) ([]byte, error) { |