diff options
Diffstat (limited to 'docs/content/en/functions/resources')
-rw-r--r-- | docs/content/en/functions/resources/Concat.md | 15 | ||||
-rw-r--r-- | docs/content/en/functions/resources/ExecuteAsTemplate.md | 10 | ||||
-rw-r--r-- | docs/content/en/functions/resources/FromString.md | 10 | ||||
-rw-r--r-- | docs/content/en/functions/resources/Minify.md | 2 | ||||
-rw-r--r-- | docs/content/en/functions/resources/ToCSS.md | 8 |
5 files changed, 31 insertions, 14 deletions
diff --git a/docs/content/en/functions/resources/Concat.md b/docs/content/en/functions/resources/Concat.md index 3bdf975bf..809ee83d0 100644 --- a/docs/content/en/functions/resources/Concat.md +++ b/docs/content/en/functions/resources/Concat.md @@ -1,6 +1,6 @@ --- title: resources.Concat -description: Concatenates a slice of resources. +description: Returns a concatenated slice of resources. categories: [] keywords: [] action: @@ -10,12 +10,17 @@ action: signatures: ['resources.Concat TARGETPATH [RESOURCE...]'] --- +The `resources.Concat` function returns a concatenated slice of resources, caching the result using the target path as its cache key. Each resource must have the same [media type]. + +Hugo publishes the resource to the target path when you call its [`Publish`], [`Permalink`], or [`RelPermalink`] methods. + +[media type]: https://en.wikipedia.org/wiki/Media_type +[`publish`]: /methods/resource/publish +[`permalink`]: /methods/resource/permalink +[`relpermalink`]: /methods/resource/relpermalink + ```go-html-template {{ $plugins := resources.Get "js/plugins.js" }} {{ $global := resources.Get "js/global.js" }} {{ $js := slice $plugins $global | resources.Concat "js/bundle.js" }} ``` - -Asset files of the same [media type] can be bundled into one resource using the `resources.Concat` function which takes two arguments, the target path for the created resource bundle and a slice of resource objects to be concatenated. - -[media type]: https://en.wikipedia.org/wiki/Media_type diff --git a/docs/content/en/functions/resources/ExecuteAsTemplate.md b/docs/content/en/functions/resources/ExecuteAsTemplate.md index d17f0580c..5f7e58413 100644 --- a/docs/content/en/functions/resources/ExecuteAsTemplate.md +++ b/docs/content/en/functions/resources/ExecuteAsTemplate.md @@ -1,6 +1,6 @@ --- title: resources.ExecuteAsTemplate -description: Creates a resource from a Go template, parsed and executed with the given context. +description: Returns a resource created from a Go template, parsed and executed with the given context. categories: [] keywords: [] action: @@ -11,7 +11,13 @@ action: signatures: [resources.ExecuteAsTemplate TARGETPATH CONTEXT RESOURCE] --- -Hugo publishes the resource to the target path when you call its`.Publish`, `.Permalink`, or `.RelPermalink` method. The resource is cached, using the target path as the cache key. +The `resources.ExecuteAsTemplate` function returns a resource created from a Go template, parsed and executed with the given context, caching the result using the target path as its cache key. + +Hugo publishes the resource to the target path when you call its [`Publish`], [`Permalink`], or [`RelPermalink`] methods. + +[`publish`]: /methods/resource/publish +[`permalink`]: /methods/resource/permalink +[`relpermalink`]: /methods/resource/relpermalink Let's say you have a CSS file that you wish to populate with values from your site configuration: diff --git a/docs/content/en/functions/resources/FromString.md b/docs/content/en/functions/resources/FromString.md index 6c22b5310..75f48ad9c 100644 --- a/docs/content/en/functions/resources/FromString.md +++ b/docs/content/en/functions/resources/FromString.md @@ -1,6 +1,6 @@ --- title: resources.FromString -description: Creates a resource from a string. +description: Returns a resource created from a string. categories: [] keywords: [] action: @@ -11,7 +11,13 @@ action: signatures: [resources.FromString TARGETPATH STRING] --- -Hugo publishes the resource to the target path when you call its`.Publish`, `.Permalink`, or `.RelPermalink` method. The resource is cached, using the target path as the cache key. +The `resources.FromString` function returns a resource created from a string, caching the result using the target path as its cache key. + +Hugo publishes the resource to the target path when you call its [`Publish`], [`Permalink`], or [`RelPermalink`] methods. + +[`publish`]: /methods/resource/publish +[`permalink`]: /methods/resource/permalink +[`relpermalink`]: /methods/resource/relpermalink Let's say you need to publish a file named "site.json" in the root of your public directory, containing the build date, the Hugo version used to build the site, and the date that the content was last modified. For example: diff --git a/docs/content/en/functions/resources/Minify.md b/docs/content/en/functions/resources/Minify.md index 44f5f990b..9749df20a 100644 --- a/docs/content/en/functions/resources/Minify.md +++ b/docs/content/en/functions/resources/Minify.md @@ -20,4 +20,4 @@ action: {{ $style := $css | minify }} ``` -Any CSS, JS, JSON, HTML, SVG or XML resource can be minified using resources.Minify which takes for argument the resource object. +Any CSS, JS, JSON, HTML, SVG, or XML resource can be minified using resources.Minify which takes for argument the resource object. diff --git a/docs/content/en/functions/resources/ToCSS.md b/docs/content/en/functions/resources/ToCSS.md index 872bf996b..d226f2688 100644 --- a/docs/content/en/functions/resources/ToCSS.md +++ b/docs/content/en/functions/resources/ToCSS.md @@ -139,8 +139,8 @@ To install Dart Sass for your builds on GitLab Pages, the `.gitlab-ci.yml` file ```yaml variables: - HUGO_VERSION: 0.115.1 - DART_SASS_VERSION: 1.63.6 + HUGO_VERSION: 0.121.0 + DART_SASS_VERSION: 1.69.5 GIT_DEPTH: 0 GIT_STRATEGY: clone GIT_SUBMODULE_STRATEGY: recursive @@ -173,8 +173,8 @@ To install Dart Sass for your builds on Netlify, the `netlify.toml` file should ```toml [build.environment] -HUGO_VERSION = "0.115.1" -DART_SASS_VERSION = "1.63.6" +HUGO_VERSION = "0.121.0" +DART_SASS_VERSION = "1.69.5" TZ = "America/Los_Angeles" [build] |