mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-14 02:16:09 +00:00
Update introduction.md
This commit is contained in:
1 parent
aca440052e
commit
b3b900f3fc
1 file changed
+12
-10
@@ -50,16 +50,6 @@ With `resources.GetRemote`, the first argument is a remote URL:
|
|||||||
|
|
||||||
`resources.Get` and `resources.GetRemote` return `nil` if the resource is not found.
|
`resources.Get` and `resources.GetRemote` return `nil` if the resource is not found.
|
||||||
|
|
||||||
## Copy a Resource
|
|
||||||
|
|
||||||
{{< new-in "0.100.0" >}}
|
|
||||||
|
|
||||||
`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 }}">
|
|
||||||
```
|
|
||||||
|
|
||||||
### Caching
|
### Caching
|
||||||
|
|
||||||
@@ -119,6 +109,18 @@ You can also change the request method and set the request body:
|
|||||||
|
|
||||||
Remote resources fetched with `resources.GetRemote` will be cached on disk. See [Configure File Caches](/getting-started/configuration/#configure-file-caches) for details.
|
Remote resources fetched with `resources.GetRemote` will be cached on disk. See [Configure File Caches](/getting-started/configuration/#configure-file-caches) for details.
|
||||||
|
|
||||||
|
|
||||||
|
## Copy a Resource
|
||||||
|
|
||||||
|
{{< new-in "0.100.0" >}}
|
||||||
|
|
||||||
|
`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 }}">
|
||||||
|
```
|
||||||
|
|
||||||
## Asset directory
|
## 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.
|
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.
|
||||||
|
|||||||
Reference in new issue
Block a user