mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05: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"
|
||||
"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) {
|
||||
|
|
Loading…
Reference in a new issue