mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-04 04:41:06 +00:00
resource/integrity: Make Data.Integrity be of type template.HTMLAttr
This commit is contained in:
parent
2650fa772b
commit
fe6a6f2737
1 changed files with 3 additions and 3 deletions
|
@ -21,6 +21,7 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"hash"
|
"hash"
|
||||||
|
"html/template"
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/gohugoio/hugo/resource"
|
"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)
|
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) {
|
func digest(h hash.Hash) ([]byte, error) {
|
||||||
|
|
Loading…
Reference in a new issue