Skip to content

Commit

Permalink
fix(build): tailwind issues resolved
Browse files Browse the repository at this point in the history
Turns out Tailwind 4 changed some stuff.
  • Loading branch information
Vheissu committed Dec 16, 2024
1 parent 8026785 commit 18a42f4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 2 additions & 4 deletions themes/aurelia-theme/assets/css/main.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@tailwind base;
@tailwind components;
@tailwind typography;
@tailwind utilities;
@import "tailwindcss/preflight";
@import "tailwindcss/utilities";

@layer utilities {
.animate-float {
Expand Down
6 changes: 6 additions & 0 deletions themes/aurelia-theme/hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
8 changes: 6 additions & 2 deletions themes/aurelia-theme/layouts/partials/head/css.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{{ $css := resources.Get "css/main.css" }}
{{ $styles := $css | css.TailwindCSS }}

{{ if hugo.IsProduction }}
<link rel="stylesheet" href="{{ .Site.BaseURL }}css/style.css">
{{ $styles = $styles | minify | fingerprint }}
<link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Integrity }}">
{{ else }}
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="{{ $styles.RelPermalink }}">
{{ end }}

0 comments on commit 18a42f4

Please sign in to comment.