content: Fix formatting

This commit is contained in:
Joe Mooring 2025-08-20 08:03:10 -07:00 committed by GitHub
parent 82885415fa
commit d77b06aa6c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,14 +27,14 @@ Step 1
Step 2
: Install the required Node.js packages in the root of your project:
```sh
```sh {copy=true}
npm i -D postcss postcss-cli autoprefixer @fullhuman/postcss-purgecss
```
Step 3
: Enable creation of the `hugo_stats.json` file when building the site. If you are only using this for the production build, consider placing it below [`config/production`].
{{< code-toggle file=hugo >}}
{{< code-toggle file=hugo copy=true >}}
[build.buildStats]
enable = true
{{< /code-toggle >}}
@ -79,7 +79,7 @@ Step 5
Step 6
: If the current environment is not `development`, process the resource with PostCSS:
```go-html-template
```go-html-template {copy=true}
{{ with resources.Get "css/main.css" }}
{{ if hugo.IsDevelopment }}
<link rel="stylesheet" href="{{ .RelPermalink }}">
@ -124,7 +124,7 @@ let tailwindConfig = process.env.HUGO_FILE_TAILWIND_CONFIG_JS || './tailwind.con
## Limitations
Do not use `resources.PostProcess` when running Hugo's built-in development server. The examples above specifically prevent this by verifying that the current environment is not "development".
Do not use `resources.PostProcess` when running Hugo's built-in development server. The examples above specifically prevent this by verifying that the current environment is not `development`.
The `resources.PostProcess` function only works within templates that produce HTML files.