You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/functions/css/Sass.md
+14-64Lines changed: 14 additions & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -122,83 +122,33 @@ Run `hugo env` to list the active transpilers.
122
122
123
123
### Installing in a production environment
124
124
125
-
For [CI/CD](g) deployments (e.g., GitHub Pages, GitLab Pages, Netlify, etc.) you must edit the workflow to install Dart Sass before Hugo builds the site[^2]. Some providers allow you to use one of the package managers above, or you can download and extract one of the prebuilt binaries.
125
+
To use Dart Sass with Hugo on a CI/CD platform like GitHub Pages, GitLab Pages, or Netlify, you typically must modify your build workflow to install Dart Sass before the Hugo site build begins. This is because these platforms don't have Dart Sass pre-installed, and Hugo needs it to process your Sass files.
126
126
127
-
[^2]: You do not have to do this if (a) you have not modified the assets cache location, and (b) you have not set `useResourceCacheWhen` to `never` in your [site configuration], and (c) you add and commit your `resources` directory to your repository.
127
+
There's one key exception where you can skip this step: you have committed your `resources` directory to your repository. This is only possible if:
128
128
129
-
#### GitHub Pages
129
+
- You have not changed Hugo's default asset cache location.
130
+
- You have not set [`useResourceCacheWhen`] to never in your sites configuration.
130
131
131
-
To install Dart Sass for your builds on GitHub Pages, add this step to the GitHub Pages workflow file:
132
+
By committing the `resources` directory, you're providing the pre-built CSS files directly to your CI/CD service, so it doesn't need to run the Sass compilation itself.
132
133
133
-
```yaml
134
-
- name: Install Dart Sass
135
-
run: sudo snap install dart-sass
136
-
```
137
-
138
-
#### GitLab Pages
139
-
140
-
To install Dart Sass for your builds on GitLab Pages, the `.gitlab-ci.yml` file should look something like this:
0 commit comments