mirror of
https://github.com/gohugoio/hugoDocs.git
synced 2025-09-13 08:56:04 -04:00
Fix resources.ExecuteAsTemplate argument order (#1394)
Co-authored-by: kjirou <sorenariblog@gmail.com>
This commit is contained in:
parent
97e2c2abb4
commit
17fae284c1
@ -18,7 +18,7 @@ draft: false
|
|||||||
|
|
||||||
In order to use Hugo Pipes function on an asset file containing Go Template magic the function `resources.ExecuteAsTemplate` must be used.
|
In order to use Hugo Pipes function on an asset file containing Go Template magic the function `resources.ExecuteAsTemplate` must be used.
|
||||||
|
|
||||||
The function takes three arguments, the resource object, the resource target path and the template context.
|
The function takes three arguments: the resource target path, the template context, and the resource object.
|
||||||
|
|
||||||
```go-html-template
|
```go-html-template
|
||||||
// assets/sass/template.scss
|
// assets/sass/template.scss
|
||||||
@ -35,4 +35,4 @@ body{
|
|||||||
```go-html-template
|
```go-html-template
|
||||||
{{ $sassTemplate := resources.Get "sass/template.scss" }}
|
{{ $sassTemplate := resources.Get "sass/template.scss" }}
|
||||||
{{ $style := $sassTemplate | resources.ExecuteAsTemplate "main.scss" . | resources.ToCSS }}
|
{{ $style := $sassTemplate | resources.ExecuteAsTemplate "main.scss" . | resources.ToCSS }}
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user