mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
Squashed 'docs/' changes from 71f739460..1ad3c75ad
1ad3c75ad theme: Run ncu -u to update dependencies (#3311) 2942d3753 content: Update version refs e298fdfaf content: Remove ref to old version c1fc876ea content: Improve taxonomic weight example d706a013d content: Document additional functions 5751c37cc content: Standardize string function signatures d65e6fae7 misc: Add data/docs.yaml to ignorePaths in cspell config ba1f98a32 content: Improve collections.First/Last string examples d7b5a2efd content: Improve collections.First/Last examples e94e49db2 content: Add Smart Hugo to editor plugins af204597a content: Clarify config description 9d1cb33cd content: Fix typo dded23962 content: Clarify note on rare use case for PageRef method 8af9e3be4 content: Update the Homebrew installation description be56390b3 content: Clarify command description fa228e9f0 content: Clarify AsciiDoc extensions setting description 3a23a4af2 docs: Add best practices for manual summary marker placement 050d7c75e misc: Fix cspell configuration 74642b18d content: Miscellaneous edits 75a2c8425 content: Add missing reference definitions6303f27e1content: Improve description of the SITE.Home method4dfbd647fRevert the minimal analytics changes (#3265)c369e534dtheme: Move tracking to turbo:load88b451022theme: Move tracking to turbo:render7040dc5eeMove to minimalanalytics for GA tracking4e8a523fbcontent: Update KaTeX link attributes to v0.16.25 (phase 2)21046b942content: Update KaTeX link attributes to v0.16.25 (phase 1)b8df9d941theme: Use Path for the glossary link destinationacd6c2954theme: Use page Path when generating Markdown links543f78340content: Fix formattingaef89d192content: Correct page collection quick-reference data08645236acontent: Use RSS output format in shortcode lookup example58654c106content: Fix archetype lookup order9f79bacc4content: Describe valid uses of the nil keyword41f139d14theme: Remove the root view transition6ab407bb9content: Improve links on lang.Translate page91e724065content: Add missing fragments to links in the module mounts description2f6b4a58ccontent: Clarify ByCount sort order8594590b2Update netlify.toml811574060content: Update version referencesa12bcf7ddcontent: Update version references23ca199edUpdate netlify.toml5d3da2351content: Update version references1617ee75bmisc: Update Netlify config to build with v0.152.06467bda93content: Remove outdated new-in badges4b3ef4bd5content: Improve description of default mount behavior5a861f500content: Revise partials.IncludeCached description and signature2ad9d705acontent: Correct the partials.IncludeCached signature9f611b879Update netlify.tomlca21f5fbdcontent: Add warning about automatic summaries2065faddecontent: Update commit message guidelinesa0784f261content: Remove outdated new-in badgesce5a249f2content: Remove Codeberg Pages documentation3424b95f2content: Update CLI docs27fd350a6content: Change KaTeX version references to 0.16.23ba8c5fd3bcontent: Change MathJax version reference from v3 to v4c83465222content: Fix broken linkc6cde1074content: Update version references467277939content: Fix typoe424b6b19content: Document new features in v0.151.0a46898f79Update netlify.tomlf8407c3b5content: Enhance content view template details974175690content: Optionally disable whitespace trimming in fenced code blocks25bffc4c4Update netlify.toml98e9ef5f0theme: Move initColorScheme() to heada1566495btheme: Preload fonts (#3209)c0271d266content: Add missing word in deploy-with-rsync.md47099c4facontent: Remove outdated new-in badges439b5c18bcontent: Fix collections.D seed exampled2486ba67content: Update description of IsNode method4de8815e9content: Update description of the cascade front matter field0801e9b3fcontent: Fix broken link9bbbfb59dcontent: Update Netlify hosting guide and version refs4f444fb53misc: Update docs.yamla7a9a7563Update module.mda7909fe37Update netlify.toml47a2c2038content: Update collections.D page to remove casting noteecca5ef48content: Update summaryLength description with default value310e11195content: Change alias examplebd6b53b5dcontent: Update minify config documentation21bb0bb66Update netlify.toml68912f1a3content: Update version reference28a47a50fcontent: Fix missing link to latest release under Prebuilt Binaries8eac2a120theme: Revise inline code span styling2e71b6d0aAdjust sponsord93340a78content: Update documentation guide9f6213ebecontent: Fix glob pattern-alternatives syntax in cascade.md1f61fd6becontent: Add seed examples to collections.D65385a5d0content: Fix Cloudflare deploy not_found_handling value4f70df235content: Fix typofc216f2d9content: Fix broken linke98b340f2Update cascade.mde316dbf93content: Update version referencesf8e863e97misc: Remove textlint config file3b9c3e2a1content: Miscellaneous updates related to v0.149.03ccc439fcUpdate netlify.toml07f5140e8Merge branch 'tempv0.149.0'17f8d33d8content: Add format option to transform.Unmarshala6a971596content: Document the collections.D function66eee712bcontent: Update front matter configuration example863945e13content: Update fmt.Println example1d9a92bc7theme: Don't exclude current section from related content1386d8ed2Update introduction.md0ac89b015content: Replace inline URLs with autolinks54fad1e01content: Fix typoe09f6b0c5content: Wrap calls to eturl shortcode in angle brackets23efd9766Merge commit 'bfa74537929f409fca841540b971125b7678963a'e98754e72resources/page: Add :sectionslug and :sectionslugs permalink tokens git-subtree-dir: docs git-subtree-split: 1ad3c75ad0e997d66598c1453db9989fde7d9680
This commit is contained in:
@@ -14,10 +14,7 @@ params:
|
||||
|
||||
Transpile Sass to CSS using the LibSass transpiler included in Hugo's extended and extended/deploy editions, or [install Dart Sass](#dart-sass) to use the latest features of the Sass language.
|
||||
|
||||
Sass has two forms of syntax: [SCSS] and [indented]. Hugo supports both.
|
||||
|
||||
[scss]: https://sass-lang.com/documentation/syntax#scss
|
||||
[indented]: https://sass-lang.com/documentation/syntax#the-indented-syntax
|
||||
Sass has two forms of syntax: [SCSS][] and [indented][]. Hugo supports both.
|
||||
|
||||
## Options
|
||||
|
||||
@@ -45,7 +42,7 @@ sourceMapIncludeSources
|
||||
: (`bool`) Whether to embed sources in the generated source map. Applicable to Dart Sass. Default is `false`.
|
||||
|
||||
targetPath
|
||||
: (`string`) The publish path for the transformed resource, relative to the[`publishDir`]. If unset, the target path defaults to the asset's original path with a `.css` extension.
|
||||
: (`string`) The publish path for the transformed resource, relative to the[`publishDir`][]. If unset, the target path defaults to the asset's original path with a `.css` extension.
|
||||
|
||||
transpiler
|
||||
: (`string`) The transpiler to use, either `libsass` or `dartsass`. Hugo's extended and extended/deploy editions include the LibSass transpiler. To use the Dart Sass transpiler, see the [installation instructions](#dart-sass). Default is `libsass`.
|
||||
@@ -61,6 +58,8 @@ vars
|
||||
@use "hugo:vars" as v;
|
||||
```
|
||||
|
||||
When when passing a `vars` map to the `css.Sass` function, Hugo detects common typed CSS values such as `24px` or `#FF0000` using regular expression matching. If necessary, you can bypass automatic type inference by using the [`css.Quoted`][] or [`css.Unquoted`][] function to explicitly indicate a value's type.
|
||||
|
||||
## Example
|
||||
|
||||
```go-html-template {copy=true}
|
||||
@@ -87,7 +86,7 @@ vars
|
||||
|
||||
## Dart Sass
|
||||
|
||||
Hugo's extended and extended/deploy editions include [LibSass] to transpile Sass to CSS. In 2020, the Sass team deprecated LibSass in favor of [Dart Sass].
|
||||
Hugo's extended and extended/deploy editions include [LibSass][] to transpile Sass to CSS. In 2020, the Sass team deprecated LibSass in favor of [Dart Sass].
|
||||
|
||||
Use the latest features of the Sass language by installing Dart Sass in your development and production environments.
|
||||
|
||||
@@ -113,7 +112,7 @@ macOS|Homebrew|[brew.sh]|`brew install sass/sass/sass`
|
||||
Windows|Chocolatey|[chocolatey.org]|`choco install sass`
|
||||
Windows|Scoop|[scoop.sh]|`scoop install sass`
|
||||
|
||||
You may also install [prebuilt binaries] for Linux, macOS, and Windows. You must install the prebuilt binary outside of your project directory and ensure its path is included in your system's PATH environment variable.
|
||||
You may also install [prebuilt binaries][] for Linux, macOS, and Windows. You must install the prebuilt binary outside of your project directory and ensure its path is included in your system's PATH environment variable.
|
||||
|
||||
Run `hugo env` to list the active transpilers.
|
||||
|
||||
@@ -127,26 +126,34 @@ To use Dart Sass with Hugo on a CI/CD platform like GitHub Pages, GitLab Pages,
|
||||
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:
|
||||
|
||||
- You have not changed Hugo's default asset cache location.
|
||||
- You have not set [`useResourceCacheWhen`] to never in your sites configuration.
|
||||
- You have not set [`useResourceCacheWhen`][] to never in your sites configuration.
|
||||
|
||||
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.
|
||||
|
||||
For examples of how to install Dart Sass in a production environment, see the following workflow files:
|
||||
For examples of how to install Dart Sass in a production environment, see these hosting guides:
|
||||
|
||||
- [Cloudflare]
|
||||
- [GitHub Pages]
|
||||
- [GitLab Pages]
|
||||
- [Netlify]
|
||||
- [Render]
|
||||
- [Vercel]
|
||||
|
||||
[`css.Quoted`]: /functions/css/quoted/
|
||||
[`css.Unquoted`]: /functions/css/unquoted/
|
||||
[`publishDir`]: /configuration/all/#publishdir
|
||||
[`useResourceCacheWhen`]: /configuration/build/#useresourcecachewhen
|
||||
[brew.sh]: https://brew.sh/
|
||||
[chocolatey.org]: https://community.chocolatey.org/packages/sass
|
||||
[dart sass]: https://sass-lang.com/dart-sass
|
||||
[GitHub Pages]: /host-and-deploy/host-on-github-pages/#step-7
|
||||
[GitLab Pages]: /host-and-deploy/host-on-gitlab-pages/#configure-gitlab-cicd
|
||||
[libsass]: https://sass-lang.com/libsass
|
||||
[Netlify]: /host-and-deploy/host-on-netlify/#configuration-file
|
||||
[Cloudflare]: /host-and-deploy/host-on-cloudflare/
|
||||
[GitHub Pages]: /host-and-deploy/host-on-github-pages/
|
||||
[GitLab Pages]: /host-and-deploy/host-on-gitlab-pages/
|
||||
[indented]: https://sass-lang.com/documentation/syntax#the-indented-syntax
|
||||
[LibSass]: https://sass-lang.com/libsass
|
||||
[Netlify]: /host-and-deploy/host-on-netlify/
|
||||
[prebuilt binaries]: https://github.com/sass/dart-sass/releases/latest
|
||||
[Render]: /host-and-deploy/host-on-render/
|
||||
[scoop.sh]: https://scoop.sh/#/apps?q=sass
|
||||
[snap package]: /installation/linux/#snap
|
||||
[SCSS]: https://sass-lang.com/documentation/syntax#scss
|
||||
[snapcraft.io]: https://snapcraft.io/dart-sass
|
||||
[Vercel]: /host-and-deploy/host-on-vercel/
|
||||
|
||||
Reference in New Issue
Block a user