Use the dartsass transpiler

This commit is contained in:
Will Faught
2023-03-05 18:29:47 -08:00
parent 7bd43af73b
commit cbf807429e
3 changed files with 15 additions and 3 deletions

View File

@@ -18,6 +18,8 @@ jobs:
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Setup Embedded Dart Sass
run: sudo snap install dart-sass-embedded
- id: pages
name: Setup Pages
uses: actions/configure-pages@v2
@@ -39,6 +41,8 @@ jobs:
# submodules: recursive
# - name: Setup Hugo
# run: choco install hugo-extended
# - name: Setup Embedded Dart Sass
# run: choco install dart-sass-embedded
# - name: Build
# run: |
# cd exampleSite

View File

@@ -77,13 +77,21 @@ please share it by [posting code or screenshots](https://github.com/willfaught/p
$ brew install node
```
3. Create a site:
3. [Install Embedded Dart Sass](https://github.com/sass/dart-sass-embedded/releases).
For Homebrew on Mac:
```sh
$ brew install sass/sass/dart-sass-embedded
```
4. Create a site:
```sh
$ hugo new site yourproject
```
4. Create a post:
5. Create a post:
```sh
$ cd yourproject

View File

@@ -19,7 +19,7 @@
{{ $resource := resources.ExecuteAsTemplate $href (or $page dict) . }}
{{ if $sass }}
{{ $resource = $resource | toCSS (dict "enableSourceMap" $enablesourcemap "includePaths" $includepaths "outputStyle" $outputstyle) }}
{{ $resource = $resource | toCSS (dict "enableSourceMap" $enablesourcemap "includePaths" $includepaths "outputStyle" $outputstyle "transpiler" "dartsass") }}
{{ end }}
{{ $resource = $resource | minify | fingerprint }}