Skip to content

Commit f0d87ab

Browse files
authored
Merge pull request #3 from rubytaiwan/add-tailwind-in-action
Add correct config of TailwinCSS
2 parents 1630a46 + 46058b3 commit f0d87ab

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

.github/workflows/github-pages.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,42 @@ jobs:
3131
id: pages
3232
uses: actions/configure-pages@v4
3333

34+
- name: Create Tailwind Config
35+
run: |
36+
if [ ! -f "tailwind.config.js" ]; then
37+
echo "Creating tailwind.config.js"
38+
cat > tailwind.config.js << 'EOL'
39+
/** @type {import('tailwindcss').Config} */
40+
module.exports = {
41+
content: [
42+
"./_drafts/**/*.md",
43+
"./_includes/**/*.html",
44+
"./_layouts/**/*.html",
45+
"./_pages/**/*.{html,md}",
46+
"./_posts/**/*.md",
47+
"./*.{html,md}",
48+
],
49+
theme: {
50+
extend: {},
51+
},
52+
plugins: [],
53+
}
54+
EOL
55+
fi
56+
3457
- name: Build Jekyll site
35-
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
58+
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" --verbose
3659
env:
3760
JEKYLL_ENV: production
3861

62+
- name: List generated files
63+
run: |
64+
echo "Generated files in _site directory:"
65+
find _site -type f | sort
66+
echo ""
67+
echo "Checking for CSS files:"
68+
find _site -name "*.css" | sort
69+
3970
- name: Upload artifact
4071
uses: actions/upload-pages-artifact@v3
4172
with:

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ plugins:
99

1010
tailwindcss:
1111
css_path: "./_tailwind.css"
12+
config: "./tailwind.config.js" # 添加此行指定 tailwind.config.js 位置
1213

1314
mail:
1415
contact: "contact@rubyconf.tw"

tailwind.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/** @type {import('tailwindcss').Config} */
2+
module.exports = {
3+
content: [
4+
"./_drafts/**/*.md",
5+
"./_includes/**/*.html",
6+
"./_layouts/**/*.html",
7+
"./_pages/**/*.{html,md}",
8+
"./_posts/**/*.md",
9+
"./*.{html,md}",
10+
],
11+
theme: {
12+
extend: {},
13+
},
14+
plugins: [],
15+
}

0 commit comments

Comments
 (0)