Merge commit 'd3927310d5b2404c3238f9b899db3329ea516490'

This commit is contained in:
Bjørn Erik Pedersen
2023-05-27 17:02:23 +02:00
75 changed files with 214 additions and 167 deletions

View File

@@ -124,10 +124,19 @@ Remote resources fetched with `resources.GetRemote` will be cached on disk. See
`resources.Copy` allows you to copy almost any Hugo `Resource` (the one exception is the `Page`), possibly most useful for renaming things:
```go-html-template
{{ $resized := $image.Resize "400x400" | resources.Copy "images/mynewname.jpg" }}
<img src="{{ $resized.RelPermalink }}">
{{ with resources.Get "img/a.jpg" }}
{{ with .Resize "300x" }}
{{ with resources.Copy "img/a-new.jpg" . }}
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
{{ end }}
{{ end }}
{{ end }}
```
{{% note %}}
The target path must be different than the source path, as shown in the example above. See GitHub issue [#10412](https://github.com/gohugoio/hugo/issues/10412).
{{% /note %}}
## Asset directory
Asset files must be stored in the asset directory. This is `/assets` by default, but can be configured via the configuration file's `assetDir` key.

View File

@@ -36,7 +36,7 @@ There are several ways to set up CSS purging with PostCSS in Hugo. If you have a
The below configuration will write a `hugo_stats.json` file to the project root as part of the build. If you're only using this for the production build, you should consider placing it below [config/production](/getting-started/configuration/#configuration-directory).
{{< code-toggle file="config" >}}
{{< code-toggle file="hugo" >}}
[build]
writeStats = true
{{< /code-toggle >}}