Skip to content

Commit 962d798

Browse files
CopilotDRSDavidSoft
andcommitted
Add SCSS build system with automated CSS minification
Co-authored-by: DRSDavidSoft <[email protected]>
1 parent a76ccd6 commit 962d798

File tree

6 files changed

+64
-1
lines changed

6 files changed

+64
-1
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ jobs:
1717
- name: Checkout code
1818
uses: actions/checkout@v4
1919

20+
- name: Set up Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20'
24+
cache: 'npm'
25+
26+
- name: Install Node dependencies
27+
run: npm ci
28+
29+
- name: Build CSS
30+
run: npm run build:css
31+
2032
- name: Set up Ruby
2133
uses: ruby/setup-ruby@v1
2234
with:

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ vendor/
1616
.bundle/
1717
Gemfile.lock
1818

19+
# Node.js
20+
node_modules/
21+
package-lock.json
22+
23+
# Generated CSS
24+
css/
25+
1926
# =========================
2027
# Operating System Files
2128
# =========================

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,30 @@
22
The cmder.net page.
33

44
[![CI](https://github.com/cmderdev/cmderdev.github.io/actions/workflows/ci.yml/badge.svg)](https://github.com/cmderdev/cmderdev.github.io/actions/workflows/ci.yml)
5+
6+
## Development
7+
8+
### Building CSS
9+
10+
This project uses SCSS for styling. The source files are in `_sass/` and the compiled CSS is generated in `css/`.
11+
12+
To build the CSS:
13+
```bash
14+
npm install
15+
npm run build:css
16+
```
17+
18+
To watch for changes and rebuild automatically:
19+
```bash
20+
npm run watch:css
21+
```
22+
23+
### Building the Site
24+
25+
The site uses Jekyll for static site generation:
26+
```bash
27+
bundle install
28+
bundle exec jekyll build
29+
```
30+
31+
The built site will be in the `_site/` directory.
File renamed without changes.

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<link rel="stylesheet" href='https://fonts.googleapis.com/css?family=Lato:300,400,700,400italic' type="text/css">
1212
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css" type="text/css">
1313
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
14-
<link rel="stylesheet" href="css/main.css" type="text/css">
14+
<link rel="stylesheet" href="css/main.min.css" type="text/css">
1515
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha384-1H217gwSVyLSIfaLxHbE7dRb3v4mYCKbpQvzx0cegeju1MVsGrX5xXxAvs/HgeFs" crossorigin="anonymous"></script>
1616
<script src="https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js" integrity="sha384-I7E8VVD/ismYTF4hNIPjVp/Zjvgyol6VFvRkX/vR+Vc4jQkC+hVqc2pM8ODewa9r" crossorigin="anonymous"></script>
1717
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-0pUGZvbkm6XF6gxjEnlmuGrJXVbNuzT9qBBavbLwCsOGabYfZo0T0to5eqruptLy" crossorigin="anonymous"></script>

package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "cmderdev.github.io",
3+
"version": "1.0.0",
4+
"description": "The cmder.net page.",
5+
"main": "index.js",
6+
"scripts": {
7+
"build:css": "sass _sass/main.scss css/main.min.css --style=compressed",
8+
"watch:css": "sass _sass/main.scss css/main.min.css --watch --style=compressed",
9+
"test": "echo \"Error: no test specified\" && exit 1"
10+
},
11+
"keywords": [],
12+
"author": "",
13+
"license": "ISC",
14+
"devDependencies": {
15+
"sass": "^1.94.0"
16+
}
17+
}

0 commit comments

Comments
 (0)