mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Merge commit '35febb2e2a3780c3338a2665fddea7dda28a17f4'
This commit is contained in:
@@ -16,7 +16,7 @@ draft: false
|
||||
---
|
||||
|
||||
|
||||
Fingerprinting and [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) can be applied to any asset file using `resources.Fingerpint` which takes two arguments, the resource object and a [hash function](https://en.wikipedia.org/wiki/Cryptographic_hash_function).
|
||||
Fingerprinting and [SRI](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) can be applied to any asset file using `resources.Fingerprint` which takes two arguments, the resource object and a [hash function](https://en.wikipedia.org/wiki/Cryptographic_hash_function).
|
||||
|
||||
The default hash function is `sha256`. Other available functions are `sha384` (from Hugo `0.55`), `sha512` and `md5`.
|
||||
|
||||
@@ -26,4 +26,4 @@ Any so processed asset will bear a `.Data.Integrity` property containing an inte
|
||||
{{ $js := resources.Get "js/global.js" }}
|
||||
{{ $secureJS := $js | resources.Fingerprint "sha512" }}
|
||||
<script type="text/javascript" src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
|
||||
```
|
||||
```
|
||||
|
Reference in New Issue
Block a user