You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/_common/methods/resource/processing-spec.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,14 +10,14 @@ action
10
10
: Specify one of `crop`, `fill`, `fit`, or `resize`. This is applicable to the [`Process`][] method and the [`images.Process`][] filter. If you specify an action, you must also provide dimensions.
11
11
12
12
anchor
13
-
: The focal point of the crop box when cropping or filling an image. Valid options include `TopLeft`, `Top`, `TopRight`, `Left`, `Center`, `Right`, `BottomLeft`, `Bottom`, `BottomRight`, or `Smart`. This defaults to the [`anchor`][]parameter in your site configuration. The `Smart` option identifies the most interesting area of the image based on the smart cropping algorithm implemented in the [`smartcrop.js`][]library.
13
+
: The focal point used when cropping or filling an image. Valid options include `TopLeft`, `Top`, `TopRight`, `Left`, `Center`, `Right`, `BottomLeft`, `Bottom`, `BottomRight`, or `Smart`. The `Smart` option utilizes the [`smartcrop.js`][]library to identify the most interesting area of the image. This defaults to the [`anchor`][]parameter in your site configuration.
14
14
15
15
background color
16
-
: The background color of the resulting image. This applies when converting an image with transparency to a format that does not support it, such as when converting from PNG to JPEG, or when rotating an image by a non-orthogonal angle into a non-transparent format. In these cases, this color fills the empty space created as the image extents increase to fit the rotated corners. The value must be an RGB [hexadecimal color][], defaulting to the [`bgColor`][] parameter in your site configuration.
16
+
: The background color used when converting transparent images to formats that do not support transparency, such as PNG to JPEG. This color also fills the empty space created when rotating an image by a non-orthogonal angle if the space is not transparent and a background color is not specified in the processing specification. The value must be an RGB [hexadecimal color][]. This defaults to the [`bgColor`][] parameter in your site configuration.
17
17
18
18
compression
19
19
: {{< new-in 0.153.5 />}}
20
-
: The compression method used when encoding an image. Valid options include `lossless` or `lossy`. The `lossless`method is only applicable to WebP images. This defaults to the [`compression`][] parameter in your site configuration.
20
+
: The encoding strategy used for the image. Options are `lossy` or `lossless`. Note that `lossless` is only supported by the WebP format. This defaults to the [`compression`][] parameter in your site configuration.
21
21
22
22
dimensions
23
23
: The dimensions of the resulting image, in pixels. The format is `WIDTHxHEIGHT` where `WIDTH` and `HEIGHT` are whole numbers. When resizing an image, you may specify only the width (such as `600x`) or only the height (such as `x400`) for proportional scaling. Specifying both width and height when resizing an image may result in non-proportional scaling. When cropping, fitting, or filling, you must provide both width and height such as `600x400`.
@@ -26,7 +26,7 @@ format
26
26
: The format of the resulting image. Valid options include `bmp`, `gif`, `jpeg`, `png`, `tiff`, or `webp`. This defaults to the format of the source image.
27
27
28
28
hint
29
-
: The encoding preset used when processing WebP images, equivalent to the `-preset` flag for the [`cwebp`][]encoder. Valid options include `drawing`, `icon`, `photo`, `picture`, or `text`. This defaults to the [`hint`][] parameter in your site configuration.
29
+
: The encoding preset used when processing WebP images, equivalent to the `-preset` flag for the [`cwebp`][]CLI. Valid options include `drawing`, `icon`, `photo`, `picture`, or `text`. This defaults to the [`hint`][] parameter in your site configuration.
30
30
31
31
Value|Example
32
32
:--|:--
@@ -37,10 +37,10 @@ hint
37
37
`text`|Image that is primarily text
38
38
39
39
quality
40
-
: The quality of the resulting image, applicable to JPEG and WebP images when using lossy[compression](#compression). The format is `qQUALITY` where `QUALITY` is a whole number between `1` and `100`, inclusive. This defaults to the [`quality`][] parameter in your site configuration.
40
+
: The visual fidelity of the image, applicable to JPEG and WebP formats when using `lossy`compression. The format is `qQUALITY` where `QUALITY` is a whole number between `1` and `100`, inclusive. Lower numbers prioritize smaller file size, while higher numbers prioritize visual clarity. This defaults to the [`quality`][] parameter in your site configuration.
41
41
42
42
resampling filter
43
-
: The filter used to calculate new pixels when resizing, fitting, or filling an image. Common options include `box`, `lanczos`, `catmullRom`, `mitchellNetravali`, `linear`, or `nearestNeighbor`. This defaults to the [`resampleFilter`][] parameter in your site configuration.
43
+
: The algorithm used to calculate new pixels when resizing, fitting, or filling an image. Common options include `box`, `lanczos`, `catmullRom`, `mitchellNetravali`, `linear`, or `nearestNeighbor`. This defaults to the [`resampleFilter`][] parameter in your site configuration.
44
44
45
45
Filter|Description
46
46
:--|:--
@@ -54,20 +54,20 @@ resampling filter
54
54
Refer to the [source documentation][] for a complete list of available resampling filters. If you wish to improve image quality at the expense of performance, you may wish to experiment with the alternative filters.
55
55
56
56
rotation
57
-
: The number of whole degrees to rotate an image counter-clockwise. The format is `rDEGREES` where `DEGREES` is a whole number. Hugo performs rotation before any other transformations, so your target dimensions and any anchor point should refer to the image orientation after rotation. Use `r90`, `r180`, or `r270` for orthogonal rotations, or arbitrary angles such as `r45`. To rotate clockwise, use a negative number such as `r-45`. To automatically rotate an image based on its EXIF orientation tag, use the [`images.AutoOrient`][] filter instead of manual rotation.
57
+
: The number of whole degrees to rotate an image counter-clockwise. The format is `rDEGREES` where `DEGREES` is a whole number. Hugo performs rotation before any other transformations, so your [target dimensions](#dimensions) and any [anchor](#anchor)should refer to the image orientation after rotation. Use `r90`, `r180`, or `r270` for orthogonal rotations, or arbitrary angles such as `r45`. To rotate clockwise, use a negative number such as `r-45`. To automatically rotate an image based on its Exif orientation tag, use the [`images.AutoOrient`][] filter instead of manual rotation.
58
58
59
-
Rotating by non-orthogonal values increases the image extents to fit the rotated corners; the resulting empty space is transparent for formats supporting alpha channels, or filled with a background color. This background color defaults to the [`bgColor`][] parameter in your site configuration unless you include a [background color](#background-color)
59
+
Rotating by non-orthogonal values increases the image extents to fit the rotated corners. For formats supporting alpha channels such as PNG or WebP, this resulting empty space is transparent by default. If the target format does not support transparency such as JPEG, or if you explicitly specify a [background color](#background-color) in the processing specification, the space is filled. If a color is required but not specified in the processing string, it defaults to the [`bgColor`][] parameter in your site configuration.
Copy file name to clipboardExpand all lines: content/en/configuration/caches.md
+41-5Lines changed: 41 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,21 +10,57 @@ This is the default configuration:
10
10
11
11
{{< code-toggle config=caches />}}
12
12
13
+
## Purpose
14
+
15
+
Hugo uses file caches to store data on disk, avoiding repeated operations within the same build and persisting data from one build to the next.
16
+
17
+
assets
18
+
: Caches processed CSS and Sass resources.
19
+
20
+
getcsv
21
+
: Caches the results of the [`data.GetCSV`][] function. Note that the `data.GetCSV` function was deprecated in v0.123.0 in favor of the [`resources.GetRemote`][] function.
22
+
23
+
getjson
24
+
: Caches the results of the [`data.GetJSON`][] function. Note that the `data.GetJSON` function was deprecated in v0.123.0 in favor of the [`resources.GetRemote`][] function.
25
+
26
+
getresource
27
+
: Caches files fetched from remote URLs via the [`resources.GetRemote`][] function.
28
+
29
+
images
30
+
: Caches processed images.
31
+
32
+
misc
33
+
: Caches miscellaneous data.
34
+
35
+
modulequeries
36
+
: Caches the results of module resolution queries.
37
+
38
+
modules
39
+
: Caches downloaded modules.
40
+
13
41
## Keys
14
42
15
43
dir
16
-
: (`string`) The absolute file system path where the cached files will be stored. You can begin the path with the `:cacheDir` or `:resourceDir`token. These tokens will be replaced with the actual configured cache directory and resource directory paths, respectively.
44
+
: (`string`) The absolute file system path where Hugo stores the cached files. You can begin the path with the `:cacheDir` or `:resourceDir`[tokens](#tokens) to anchor the cache to specific system or project locations.
17
45
18
46
maxAge
19
-
: (`string`) The [duration](g) a cached entry remains valid before being evicted. A value of `0` disables the cache. A value of `-1` means the cache entry never expires (the default).
47
+
: (`string`) The duration a cached entry remains valid before being evicted, expressed as a [duration](g). A value of `0` disables the cache for that key, and a value of `-1` means the cache entry never expires. Default is `-1`.
20
48
21
49
## Tokens
22
50
23
51
`:cacheDir`
24
-
: (`string`) The designated cache directory. See [details](/configuration/all/#cachedir).
52
+
: (`string`) The designated cache directory. See[details](/configuration/all/#cachedir).
25
53
26
54
`:project`
27
-
: (`string`) The base directory name of the current Hugo project. By default, this ensures each project has isolated file caches, so running`hugo --gc`will only affect the current project's cache and not those of other Hugo projects on the same machine.
55
+
: (`string`) The base directory name of the current Hugo project. This ensures isolated file caches for each project, preventing the`hugo --gc`command from affecting other projects on the same machine.
28
56
29
57
`:resourceDir`
30
-
: (`string`) The designated directory for caching output from [asset pipelines](g). See [details](/configuration/all/#resourcedir).
58
+
: (`string`) The designated directory for caching output from [asset pipelines](g). See [details](/configuration/all/#resourcedir).
59
+
60
+
## Garbage collection
61
+
62
+
As you modify your site or change your configuration, cached files from previous builds may remain on disk, consuming unnecessary space. Use the `hugo --gc` command to remove these expired or unused entries from the file cache.
Copy file name to clipboardExpand all lines: content/en/configuration/deployment.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,13 +53,13 @@ cloudFrontDistributionID
53
53
: (`string`) The CloudFront Distribution ID, applicable if you are using the Amazon Web Services CloudFront CDN. Hugo will invalidate the CDN when deploying this target.
54
54
55
55
exclude
56
-
: (`string`) A [glob](g) pattern matching files to exclude when deploying to this target. Local files failing the include/exclude filters are not uploaded, and remote files failing these filters are not deleted.
56
+
: (`string`) A [glob pattern](g) matching files to exclude when deploying to this target. Local files failing the include/exclude filters are not uploaded, and remote files failing these filters are not deleted.
57
57
58
58
googleCloudCDNOrigin
59
59
: (`string`) The Google Cloud project and CDN origin to invalidate when deploying this target, specified as `<project>/<origin>`.
60
60
61
61
include
62
-
: (`string`) A [glob](g) pattern matching files to include when deploying to this target. Local files failing the include/exclude filters are not uploaded, and remote files failing these filters are not deleted.
62
+
: (`string`) A [glob pattern](g) matching files to include when deploying to this target. Local files failing the include/exclude filters are not uploaded, and remote files failing these filters are not deleted.
: (`bool`) Whether to respect the `no-store` directive in the server's `Cache-Control` response header when fetching remote resources via the [`resources.GetRemote`][] function. Default is `false`.
58
58
59
59
cache.for.excludes
60
-
: (`string`) A list of [glob](g) patterns to exclude from caching. In its default configuration HTTP caching excludes all files.
60
+
: (`[]string`) A slice of [glob patterns](g) to exclude from caching. In its default configuration HTTP caching excludes all files.
61
61
62
62
cache.for.includes
63
-
: (`string`) A list of [glob](g) patterns to cache.
63
+
: (`[]string`) A slice of [glob patterns](g) to cache.
64
64
65
65
polls
66
66
: A slice of polling configurations.
@@ -75,10 +75,10 @@ polls.low
75
75
: (`string`) The minimum polling interval expressed as a [duration](g). This is used after a recent change and gradually increases towards `polls.high`. Default is `0s`.
76
76
77
77
polls.for.excludes
78
-
: (`string`) A list of [glob](g) patterns to exclude from polling for this configuration.
78
+
: (`[]string`) A slice of [glob patterns](g) to exclude from polling for this configuration.
79
79
80
80
polls.for.includes
81
-
: (`string`) A list of [glob](g) patterns to include in polling for this configuration.
81
+
: (`[]string`) A slice of [glob patterns](g) to include in polling for this configuration.
82
82
83
83
## HTTP polling
84
84
@@ -109,10 +109,10 @@ polls.low
109
109
: (`string`) The minimum polling interval expressed as a [duration](g). This is used after a recent change and gradually increases towards `polls.high`. Default is `0s`.
110
110
111
111
polls.for.excludes
112
-
: (`string`) A list of [glob](g) patterns to exclude from polling for this configuration.
112
+
: (`[]string`) A list of [glob patterns](g) to exclude from polling for this configuration.
113
113
114
114
polls.for.includes
115
-
: (`string`) A list of [glob](g) patterns to include in polling for this configuration.
115
+
: (`[]string`) A list of [glob patterns](g) to include in polling for this configuration.
0 commit comments