From 9e6f1347d64692b8364b7726d7bd99b12ee5cea2 Mon Sep 17 00:00:00 2001 From: Felicitas Pojtinger Date: Tue, 18 Jun 2024 20:12:55 -0700 Subject: [PATCH] refactor: Switch to `dart-sass` --- .gitignore | 2 +- Hydrunfile | 2 +- Makefile | 4 ++-- layouts/_default/baseof.html | 11 +++++++---- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index fbb6e67..bd164f6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ public resources node_modules out -static/fonts +static/assets diff --git a/Hydrunfile b/Hydrunfile index bbbf6fe..6e71b6d 100755 --- a/Hydrunfile +++ b/Hydrunfile @@ -5,7 +5,7 @@ set -e # Frontend if [ "$1" = "pwa" ]; then # Install Hugo - apk add curl make hugo npm + apk add curl make hugo dart-sass npm # Generate dependencies make depend diff --git a/Makefile b/Makefile index 9cd2750..ad3a9b7 100644 --- a/Makefile +++ b/Makefile @@ -50,6 +50,6 @@ clean: depend: npm i find node_modules/@patternfly/patternfly/ -name "*.css" -type f -delete - rm -rf static/fonts + rm -rf static/assets mkdir -p static - cp -r node_modules/@patternfly/patternfly/assets/fonts static + cp -r node_modules/@patternfly/patternfly/assets static diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 3854bfe..c614ff3 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -26,10 +26,13 @@ content="© {{ now.Year }} {{ .Site.Data.site.author }}" /> - + {{ $opts := dict + "transpiler" "dartsass" + "includePaths" (slice "node_modules") + }} + {{ with resources.Get `scss/main.scss` | resources.ExecuteAsTemplate `main.scss` . | toCSS $opts | minify }} + + {{ end }}