From 18a42f4db3af23c05d614fb9228d2424270c91a1 Mon Sep 17 00:00:00 2001 From: Dwayne Charrington Date: Mon, 16 Dec 2024 10:42:00 +1000 Subject: [PATCH] fix(build): tailwind issues resolved Turns out Tailwind 4 changed some stuff. --- .github/workflows/hugo.yml | 4 ---- package.json | 8 +++----- themes/aurelia-theme/assets/css/main.css | 6 ++---- themes/aurelia-theme/hugo.toml | 6 ++++++ themes/aurelia-theme/layouts/partials/head/css.html | 8 ++++++-- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 7a723c9..56263a0 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -52,10 +52,6 @@ jobs: - name: Install Node.js dependencies run: npm ci - - # Add Tailwind CSS build step - - name: Build Tailwind CSS - run: npm run build:tw # New steps for Aurelia 2 build - name: Clean Aurelia 2 directory diff --git a/package.json b/package.json index 3af4419..8a44ad6 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,9 @@ "version": "1.0.0", "description": "Aurelia documentation website", "scripts": { - "dev": "concurrently npm:watch:*", - "build": "npm run build:tw && hugo --minify", - "watch:tw": "tailwindcss -i ./themes/aurelia-theme/assets/css/main.css -o ./themes/aurelia-theme/static/css/style.css --watch", - "watch:hugo": "hugo server", - "build:tw": "tailwindcss -i ./themes/aurelia-theme/assets/css/main.css -o ./themes/aurelia-theme/static/css/style.css --minify" + "dev": "hugo server", + "build": "hugo --minify", + "start": "hugo server" }, "devDependencies": { "@tailwindcss/cli": "^4.0.0-beta.7", diff --git a/themes/aurelia-theme/assets/css/main.css b/themes/aurelia-theme/assets/css/main.css index 1e6fb6f..f622594 100644 --- a/themes/aurelia-theme/assets/css/main.css +++ b/themes/aurelia-theme/assets/css/main.css @@ -1,7 +1,5 @@ -@tailwind base; -@tailwind components; -@tailwind typography; -@tailwind utilities; +@import "tailwindcss/preflight"; +@import "tailwindcss/utilities"; @layer utilities { .animate-float { diff --git a/themes/aurelia-theme/hugo.toml b/themes/aurelia-theme/hugo.toml index 2070790..589c730 100644 --- a/themes/aurelia-theme/hugo.toml +++ b/themes/aurelia-theme/hugo.toml @@ -25,6 +25,12 @@ title = 'Aurelia' [module.hugoVersion] extended = false min = "0.116.0" + [[module.mounts]] + source = "assets" + target = "assets" + [[module.mounts]] + source = "static" + target = "static" [permalinks] blog = "/blog/:year/:date.2006-01/:day/:slug/" diff --git a/themes/aurelia-theme/layouts/partials/head/css.html b/themes/aurelia-theme/layouts/partials/head/css.html index bb027c0..4ae0db3 100644 --- a/themes/aurelia-theme/layouts/partials/head/css.html +++ b/themes/aurelia-theme/layouts/partials/head/css.html @@ -1,5 +1,9 @@ +{{ $css := resources.Get "css/main.css" }} +{{ $styles := $css | css.TailwindCSS }} + {{ if hugo.IsProduction }} - + {{ $styles = $styles | minify | fingerprint }} + {{ else }} - + {{ end }} \ No newline at end of file