Merge commit 'a6e635ca7d905d9ec3ffd708db2694f680b03aae'

This commit is contained in:
Bjørn Erik Pedersen
2024-08-09 15:17:43 +02:00
143 changed files with 3258 additions and 2109 deletions

View File

@@ -4,7 +4,6 @@ description: Compiles the given JavaScript resource with Babel.
categories: []
keywords: []
action:
aliases: [babel]
related:
- functions/js/Build
- functions/resources/Fingerprint
@@ -12,8 +11,15 @@ action:
returnType: resource.Resource
signatures: ['resources.Babel [OPTIONS] RESOURCE']
toc: true
expiryDate: 2025-06-24 # deprecated 2024-06-24
---
{{% deprecated-in 0.128.0 %}}
Use [js.Babel] instead.
[js.Babel]: /functions/js/babel/
{{% /deprecated-in %}}
```go-html-template
{{ with resources.Get "js/main.js" }}
{{ if hugo.IsDevelopment }}

View File

@@ -26,7 +26,7 @@ The [media type] is typically one of `image`, `text`, `audio`, `video`, or `appl
{{% note %}}
This function operates on global resources. A global resource is a file within the assets directory, or within any directory mounted to the assets directory.
For page resources, use the [`Resources.ByType`] method on the Page object.
For page resources, use the [`Resources.ByType`] method on a `Page` object.
[`Resources.ByType`]: /methods/page/resources/
{{% /note %}}

View File

@@ -9,8 +9,6 @@ action:
signatures: [resources.Copy TARGETPATH RESOURCE]
---
{{< new-in 0.100.0 >}}
```go-html-template
{{ with resources.Get "images/a.jpg" }}
{{ with resources.Copy "img/new-image-name.jpg" . }}

View File

@@ -6,12 +6,11 @@ keywords: []
action:
aliases: [fingerprint]
related:
- functions/js/Build
- functions/resources/Babel
- functions/resources/Minify
- functions/resources/PostCSS
- functions/resources/PostProcess
- functions/resources/ToCSS
- functions/css/Sass
- functions/css/TailwindCSS
- functions/js/Build
- functions/js/Babel
returnType: resource.Resource
signatures: ['resources.Fingerprint [ALGORITHM] RESOURCE']
---

View File

@@ -24,7 +24,7 @@ Let's say you need to publish a file named "site.json" in the root of your publi
```json
{
"build_date": "2024-02-19T12:27:05-08:00",
"hugo_version": "0.126.0",
"hugo_version": "0.128.0",
"last_modified": "2024-02-19T12:01:42-08:00"
}
```

View File

@@ -24,7 +24,7 @@ action:
{{% note %}}
This function operates on global resources. A global resource is a file within the assets directory, or within any directory mounted to the assets directory.
For page resources, use the [`Resources.Get`] method on the Page object.
For page resources, use the [`Resources.Get`] method on a `Page` object.
[`Resources.Get`]: /methods/page/resources/
{{% /note %}}

View File

@@ -24,7 +24,7 @@ action:
{{% note %}}
This function operates on global resources. A global resource is a file within the assets directory, or within any directory mounted to the assets directory.
For page resources, use the [`Resources.GetMatch`] method on the Page object.
For page resources, use the [`Resources.GetMatch`] method on a `Page` object.
[`Resources.GetMatch`]: /methods/page/resources/
{{% /note %}}

View File

@@ -24,7 +24,7 @@ action:
{{% note %}}
This function operates on global resources. A global resource is a file within the assets directory, or within any directory mounted to the assets directory.
For page resources, use the [`Resources.Match`] method on the Page object.
For page resources, use the [`Resources.Match`] method on a `Page` object.
[`Resources.Match`]: /methods/page/resources/
{{% /note %}}

View File

@@ -6,11 +6,11 @@ keywords: []
action:
aliases: [minify]
related:
- functions/js/Build
- functions/resources/Babel
- functions/resources/Fingerprint
- functions/resources/PostCSS
- functions/resources/ToCSS
- functions/css/Sass
- functions/css/TailwindCSS
- functions/js/Build
- functions/js/Babel
returnType: resource.Resource
signatures: [resources.Minify RESOURCE]
---

View File

@@ -4,17 +4,23 @@ description: Processes the given resource with PostCSS using any PostCSS plugin.
categories: []
keywords: []
action:
aliases: [postCSS]
related:
- functions/resources/Fingerprint
- functions/resources/Minify
- functions/resources/PostProcess
- functions/resources/ToCSS
- functions/css/Sass
returnType: resource.Resource
signatures: ['resources.PostCSS [OPTIONS] RESOURCE']
toc: true
expiryDate: 2025-06-24 # deprecated 2024-06-24
---
{{% deprecated-in 0.128.0 %}}
Use [css.PostCSS] instead.
[css.PostCSS]: /functions/css/postcss/
{{% /deprecated-in %}}
```go-html-template
{{ with resources.Get "css/main.css" | postCSS }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
@@ -126,4 +132,4 @@ module.exports = {
[node.js]: https://nodejs.org/en/download
[postcss plugins]: https://www.postcss.parts/
[supported file name]: https://github.com/postcss/postcss-load-config#usage
[transpile to CSS]: /functions/resources/tocss.md
[transpile to CSS]: /functions/css/sass/

View File

@@ -6,10 +6,8 @@ keywords: []
action:
aliases: []
related:
- functions/resources/Fingerprint
- functions/resources/Minify
- functions/resources/PostCSS
- functions/resources/ToCSS
- functions/css/PostCSS
- functions/css/Sass
returnType: postpub.PostPublishedResource
signatures: [resources.PostProcess RESOURCE]
toc: true
@@ -149,7 +147,7 @@ You cannot manipulate the values returned from the resources methods. For exa
```go-html-template
{{ $css := resources.Get "css/main.css" }}
{{ $css = $css | resources.PostCSS | minify | fingerprint | resources.PostProcess }}
{{ $css = $css | css.PostCSS | minify | fingerprint | resources.PostProcess }}
{{ $css.RelPermalink | strings.ToUpper }}
```

View File

@@ -4,17 +4,23 @@ description: Transpiles Sass to CSS.
categories: []
keywords: []
action:
aliases: [toCSS]
related:
- functions/resources/Fingerprint
- functions/resources/Minify
- functions/resources/PostCSS
- functions/css/PostCSS
- functions/resources/PostProcess
returnType: resource.Resource
signatures: ['resources.ToCSS [OPTIONS] RESOURCE']
toc: true
expiryDate: 2025-06-24 # deprecated 2024-06-24
---
{{% deprecated-in 0.128.0 %}}
Use [css.Sass] instead.
[css.Sass]: /functions/css/sass/
{{% /deprecated-in %}}
```go-html-template
{{ with resources.Get "sass/main.scss" }}
{{ $opts := dict "transpiler" "libsass" "targetPath" "css/style.css" }}
@@ -76,7 +82,7 @@ includePaths
"transpiler" "dartsass"
"targetPath" "css/style.css"
"vars" site.Params.styles
"enableSourceMap" (not hugo.IsProduction)
"enableSourceMap" (not hugo.IsProduction)
"includePaths" (slice "node_modules/bootstrap/scss")
}}
{{ with resources.Get "sass/main.scss" | toCSS $opts | minify | fingerprint }}
@@ -139,8 +145,8 @@ To install Dart Sass for your builds on GitLab Pages, the `.gitlab-ci.yml` file
```yaml
variables:
HUGO_VERSION: 0.126.0
DART_SASS_VERSION: 1.77.1
HUGO_VERSION: 0.128.0
DART_SASS_VERSION: 1.77.5
GIT_DEPTH: 0
GIT_STRATEGY: clone
GIT_SUBMODULE_STRATEGY: recursive
@@ -173,8 +179,8 @@ To install Dart Sass for your builds on Netlify, the `netlify.toml` file should
```toml
[build.environment]
HUGO_VERSION = "0.126.0"
DART_SASS_VERSION = "1.77.1"
HUGO_VERSION = "0.128.0"
DART_SASS_VERSION = "1.77.5"
TZ = "America/Los_Angeles"
[build]