Skip to content

Commit 6866741

Browse files
committed
init
1 parent 3af4d47 commit 6866741

File tree

21 files changed

+1755
-1
lines changed

21 files changed

+1755
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Build and Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Build website
27+
run: npm run build
28+
29+
- name: Deploy to GitHub Pages
30+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
31+
uses: peaceiris/actions-gh-pages@v3
32+
with:
33+
github_token: ${{ secrets.GITHUB_TOKEN }}
34+
publish_dir: ./public
35+
publish_branch: gh-pages

.gitignore

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build outputs
5+
dist/
6+
build/
7+
.nyc_output/
8+
coverage/
9+
10+
# Environment variables
11+
.env
12+
.env.local
13+
.env.development.local
14+
.env.test.local
15+
.env.production.local
16+
17+
# IDE files
18+
.vscode/
19+
.idea/
20+
*.swp
21+
*.swo
22+
*~
23+
24+
# OS generated files
25+
.DS_Store
26+
.DS_Store?
27+
._*
28+
.Spotlight-V100
29+
.Trashes
30+
ehthumbs.db
31+
Thumbs.db
32+
33+
# Logs
34+
logs/
35+
*.log
36+
37+
# Runtime data
38+
pids/
39+
*.pid
40+
*.seed
41+
*.pid.lock
42+
43+
# Coverage directory used by tools like istanbul
44+
coverage/
45+
46+
# Temporary folders
47+
tmp/
48+
temp/
49+
50+
# npm debug log
51+
npm-debug.log*
52+
yarn-debug.log*
53+
yarn-error.log*
54+
55+
# Local development server
56+
.sass-cache/
57+
connect.lock
58+
.nodemon
59+
.hypermodules/
60+
61+
# Editor temporary files
62+
*.tmp
63+
*.bak
64+
*.orig
65+
66+
# GitHub
67+
# Ignore everything in .github except workflows
68+
.github/*
69+
!.github/workflows/

README.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,52 @@
1-
# Rockchip-AI-Lab
1+
# Rockchip AI Lab Website
2+
3+
This repository contains the source code for the Rockchip AI Lab website, built with HTML, CSS, and JavaScript.
4+
5+
## Project Structure
6+
7+
```
8+
Rockchip-AI-Lab/
9+
├── public/ # Built website files (deployed to GitHub Pages)
10+
├── src/ # Source files
11+
│ ├── pages/ # HTML pages (Home, CV, LLM, VLM, UI)
12+
│ ├── components/ # Reusable components (navigation, RK chips header)
13+
│ └── styles.css # Main stylesheet
14+
├── .github/workflows/ # GitHub Actions workflows
15+
├── build.js # Build script
16+
├── package.json # Project configuration
17+
└── README.md # This file
18+
```
19+
20+
## Pages
21+
22+
The website includes the following pages:
23+
- Home
24+
- Computer Vision (CV)
25+
- Large Language Models (LLM)
26+
- Visual Language Models (VLM)
27+
- User Interface (UI)
28+
29+
Each page features information about Rockchip processors RK3588 and RK1820 at the top.
30+
31+
## Development
32+
33+
To run the project locally:
34+
35+
1. Install dependencies:
36+
```bash
37+
npm install
38+
```
39+
40+
2. Build the website:
41+
```bash
42+
npm run build
43+
```
44+
45+
3. Start a local server:
46+
```bash
47+
npm start
48+
```
49+
50+
## Deployment
51+
52+
The website is automatically deployed to GitHub Pages using GitHub Actions when changes are pushed to the `main` branch.

build.js

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
// Define source and destination directories
5+
const srcDir = './src';
6+
const publicDir = './public';
7+
8+
// Create public directory if it doesn't exist
9+
if (!fs.existsSync(publicDir)) {
10+
fs.mkdirSync(publicDir, { recursive: true });
11+
}
12+
13+
// Copy HTML files from src/pages to public
14+
const pagesDir = path.join(srcDir, 'pages');
15+
const files = fs.readdirSync(pagesDir);
16+
17+
files.forEach(file => {
18+
if (path.extname(file) === '.html') {
19+
const srcPath = path.join(pagesDir, file);
20+
const destPath = path.join(publicDir, file);
21+
22+
let content = fs.readFileSync(srcPath, 'utf8');
23+
24+
// Update relative paths to work from public directory
25+
content = content.replace(/\.\.\/styles\.css/g, 'styles.css');
26+
content = content.replace(/\.\.\/components/g, 'components');
27+
28+
fs.writeFileSync(destPath, content);
29+
console.log(`Copied ${file} to public directory`);
30+
}
31+
});
32+
33+
// Copy CSS file
34+
const cssSrc = path.join(srcDir, 'styles.css');
35+
const cssDest = path.join(publicDir, 'styles.css');
36+
if (fs.existsSync(cssSrc)) {
37+
fs.copyFileSync(cssSrc, cssDest);
38+
console.log('Copied styles.css to public directory');
39+
} else {
40+
// Create a default styles.css if it doesn't exist
41+
const defaultCSS = `
42+
/* Global Styles */
43+
body {
44+
font-family: 'Arial', sans-serif;
45+
margin: 0;
46+
padding: 0;
47+
background-color: #f5f5f5;
48+
color: #333;
49+
}
50+
51+
/* Navigation Styles */
52+
.navbar {
53+
background-color: #2c3e50;
54+
padding: 1rem 0;
55+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
56+
}
57+
58+
.nav-container {
59+
max-width: 1200px;
60+
margin: 0 auto;
61+
display: flex;
62+
justify-content: space-between;
63+
align-items: center;
64+
padding: 0 2rem;
65+
}
66+
67+
.nav-logo {
68+
color: white;
69+
font-size: 1.5rem;
70+
text-decoration: none;
71+
font-weight: bold;
72+
}
73+
74+
.nav-menu {
75+
display: flex;
76+
list-style: none;
77+
margin: 0;
78+
padding: 0;
79+
}
80+
81+
.nav-item {
82+
margin-left: 2rem;
83+
}
84+
85+
.nav-link {
86+
color: white;
87+
text-decoration: none;
88+
transition: color 0.3s;
89+
}
90+
91+
.nav-link:hover {
92+
color: #3498db;
93+
}
94+
95+
/* RK Chips Header */
96+
.rk-chips-header {
97+
background-color: #ecf0f1;
98+
padding: 1rem 2rem;
99+
display: flex;
100+
justify-content: space-around;
101+
border-bottom: 1px solid #bdc3c7;
102+
}
103+
104+
.rk-chip {
105+
text-align: center;
106+
padding: 1rem;
107+
background-color: white;
108+
border-radius: 8px;
109+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
110+
width: 45%;
111+
}
112+
113+
.rk-chip h3 {
114+
margin: 0 0 0.5rem 0;
115+
color: #2c3e50;
116+
}
117+
118+
/* Container for page content */
119+
.container {
120+
max-width: 1200px;
121+
margin: 2rem auto;
122+
padding: 0 2rem;
123+
background-color: white;
124+
border-radius: 8px;
125+
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
126+
padding: 2rem;
127+
}
128+
129+
h1 {
130+
color: #2c3e50;
131+
border-bottom: 2px solid #3498db;
132+
padding-bottom: 0.5rem;
133+
}
134+
135+
/* Responsive adjustments */
136+
@media (max-width: 768px) {
137+
.nav-container {
138+
flex-direction: column;
139+
padding: 1rem;
140+
}
141+
142+
.nav-menu {
143+
margin-top: 1rem;
144+
}
145+
146+
.nav-item {
147+
margin: 0 1rem;
148+
}
149+
150+
.rk-chips-header {
151+
flex-direction: column;
152+
}
153+
154+
.rk-chip {
155+
width: 100%;
156+
margin-bottom: 1rem;
157+
}
158+
}
159+
`;
160+
fs.writeFileSync(cssDest, defaultCSS);
161+
console.log('Created default styles.css in public directory');
162+
}
163+
164+
// Copy components directory
165+
const componentsSrc = path.join(srcDir, 'components');
166+
const componentsDest = path.join(publicDir, 'components');
167+
168+
if (!fs.existsSync(componentsDest)) {
169+
fs.mkdirSync(componentsDest, { recursive: true });
170+
}
171+
172+
const componentFiles = fs.readdirSync(componentsSrc);
173+
componentFiles.forEach(file => {
174+
const srcPath = path.join(componentsSrc, file);
175+
const destPath = path.join(componentsDest, file);
176+
fs.copyFileSync(srcPath, destPath);
177+
console.log(`Copied ${file} to public/components directory`);
178+
});
179+
180+
console.log('Build completed successfully!');

0 commit comments

Comments
 (0)