Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fingerprinting, asset management: minor improvements #2003

Merged
merged 2 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/en/content-management/organization/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ The `url` is the entire URL path, defined by the file path and optionally overri
[homepage template]: /templates/homepage/
[homepage]: /templates/homepage/
[lists]: /templates/lists/
[pretty]: /content-management/urls/#pretty-urls
[pretty]: /content-management/urls/#appearance
[section templates]: /templates/section-templates/
[sections]: /content-management/sections/
[singles]: /templates/single-page-templates/
Expand Down
2 changes: 1 addition & 1 deletion content/en/content-management/shortcodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ The `highlight` shortcode example above would produce the following HTML when th
{{< /output >}}

{{% note "More on Syntax Highlighting" %}}
To see even more options for adding syntax-highlighted code blocks to your website, see [Syntax Highlighting in Developer Tools](/tools/syntax-highlighting/).
To see even more options for adding syntax-highlighted code blocks to your website, see [Syntax Highlighting in Developer Tools](/content-management/syntax-highlighting/).
{{% /note %}}

### `instagram`
Expand Down
2 changes: 1 addition & 1 deletion content/en/getting-started/directory-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ From **Hugo 0.31** you can have multiple static directories.
: Caches some files to speed up generation. Can be also used by template authors to distribute built Sass files, so you don't have to have the preprocessor installed. Note: resources directory is not created by default.

[archetypes]: /content-management/archetypes/
[`assets`]: /hugo-pipes/introduction#asset-directory/
[`assets`]: /hugo-pipes/introduction#asset-directory
[configuration directives]: /getting-started/configuration/#all-configuration-settings
[`content`]: /content-management/organization/
[content section]: /content-management/sections/
Expand Down
2 changes: 1 addition & 1 deletion content/en/hosting-and-deployment/hosting-on-netlify.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ You now have a live website served over HTTPS, distributed through CDN, and conf
3. [Redirects and Rewrite Rules]

[app.netlify.com]: https://app.netlify.com
[build command]: /getting-started/usage/#the-hugo-command
[build command]: /getting-started/usage/#build-your-site
[config]: /getting-started/configuration/
[ghsm]: https://github.com/blog/2104-working-with-submodules
[gitsm]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
Expand Down
6 changes: 3 additions & 3 deletions content/en/hugo-pipes/fingerprint.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ weight: 70
sections_weight: 70
---

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).
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 algorithm](https://en.wikipedia.org/wiki/Secure_Hash_Algorithms).

The default hash function is `sha256`. Other available functions are `sha384` (from Hugo `0.55`), `sha512` and `md5`.
The default hash algorithm is `sha256`. Other available algorithms are `sha384` and (as of Hugo `0.55`) `sha512` and `md5`.

Any so processed asset will bear a `.Data.Integrity` property containing an integrity string, which is made up of the name of the hash function, one hyphen and the base64-encoded hash sum.
Any so processed asset will bear a `.Data.Integrity` property containing an integrity string, which is made up of the name of the hash algorithm, one hyphen and the base64-encoded hash sum.

```go-html-template
{{ $js := resources.Get "js/global.js" }}
Expand Down
2 changes: 1 addition & 1 deletion content/en/hugo-pipes/scss-sass.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ transpiler [string]
: The `transpiler` to use, valid values are `libsass` (default) and `dartsass`. If you want to use Hugo with Dart Sass you need to download a release binary from [Embedded Dart Sass](https://github.com/sass/dart-sass-embedded/releases) and make sure it's in your PC's `$PATH` (or `%PATH%` on Windows).

targetPath [string]
: If not set, the resource's target path will be the asset file original path with its extension replaced by `.css`.
: If not set, the transformed resource's target path will be the asset file original path with its extension replaced by `.css`.

vars [map]
: Map of key/value pairs that will be available in the `hugo:vars` namespace, e.g. with `@use "hugo:vars" as v;` or (globally) with `@import "hugo:vars";` {{< new-in "0.109.0" >}}
Expand Down
2 changes: 1 addition & 1 deletion content/en/tools/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ One of Hugo's greatest strengths is its passionate---and always evolving---devel
[See the popularity of Hugo compared with other static site generators.][staticgen]

[staticgen]: https://staticgen.com
[syntax]: /tools/syntax-highlighting/
[syntax]: /content-management/syntax-highlighting/
2 changes: 1 addition & 1 deletion content/en/variables/site.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ All the methods below, e.g. `.Site.RegularPages` can also be reached via the glo
: top-level directories of the site.

.Site.Taxonomies
: the [taxonomies](/taxonomies/usage/) for the entire site. Also see section [Use `.Site.Taxonomies` Outside of Taxonomy Templates](/variables/taxonomy/#use-sitetaxonomies-outside-of-taxonomy-templates).
: the [taxonomies](/content-management/taxonomies/) for the entire site. Also see section [Access taxonomy data from any template](/variables/taxonomy/#access-taxonomy-data-from-any-template).

.Site.Title
: a string representing the title of the site.
Expand Down