mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-02 19:52:38 +00:00
Fingerprinting, asset management: minor improvements (#2003)
* Fingerprinting, asset management: minor improvements * Fixing anchor links
This commit is contained in:
committed by
GitHub
parent
bcbc519bb9
commit
4aceb68551
@@ -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/
|
||||
|
||||
@@ -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`
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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" }}
|
||||
|
||||
@@ -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" >}}
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user