Skip to content

Commit f1b1455

Browse files
committed
Use Vite to reimplement site
1 parent 3985c67 commit f1b1455

File tree

19 files changed

+1333
-217
lines changed

19 files changed

+1333
-217
lines changed

.github/workflows/static.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,21 @@ name: Deploy static content to Pages
44
on:
55
# Runs on pushes targeting the default branch
66
push:
7-
branches: ["main"]
7+
branches: ['main']
88

99
# Allows you to run this workflow manually from the Actions tab
1010
workflow_dispatch:
1111

12-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
# Sets the GITHUB_TOKEN permissions to allow deployment to GitHub Pages
1313
permissions:
1414
contents: read
1515
pages: write
1616
id-token: write
1717

18-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
18+
# Allow one concurrent deployment
2019
concurrency:
21-
group: "pages"
22-
cancel-in-progress: false
20+
group: 'pages'
21+
cancel-in-progress: true
2322

2423
jobs:
2524
# Single deploy job since we're just deploying
@@ -30,14 +29,23 @@ jobs:
3029
runs-on: ubuntu-latest
3130
steps:
3231
- name: Checkout
33-
uses: actions/checkout@v4
32+
uses: actions/checkout@v5
33+
- name: Set up Node
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: lts/*
37+
cache: 'npm'
38+
- name: Install dependencies
39+
run: npm ci
40+
- name: Build
41+
run: npm run build
3442
- name: Setup Pages
3543
uses: actions/configure-pages@v5
3644
- name: Upload artifact
37-
uses: actions/upload-pages-artifact@v3
45+
uses: actions/upload-pages-artifact@v4
3846
with:
39-
# Upload entire repository
40-
path: './site'
47+
# Upload dist folder
48+
path: './dist'
4149
- name: Deploy to GitHub Pages
4250
id: deployment
43-
uses: actions/deploy-pages@v4
51+
uses: actions/deploy-pages@v4

site/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

site/bat-build-watch.bat

Lines changed: 0 additions & 7 deletions
This file was deleted.

site/bat-localhost.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ if not defined in_subprocess (cmd /k set in_subprocess=y ^& %0 %*) & exit
44
cls
55

66
:: Test site locally
7-
npx live-server
7+
npm run dev

site/build/main.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

site/build/main.d.ts.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

site/build/main.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

site/build/main.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

site/index.css

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
body {
2+
padding: 50px;
3+
background-color: #0d1117;
4+
color: #c9d1d9;
5+
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
6+
}
7+
8+
h1 {
9+
margin-bottom: 30px;
10+
color: #58a6ff;
11+
}
12+
13+
textarea {
14+
width: 100%;
15+
height: 200px;
16+
margin-bottom: 20px;
17+
font-family: monospace;
18+
background-color: #161b22;
19+
color: #c9d1d9;
20+
border: 1px solid #30363d;
21+
border-radius: 8px;
22+
padding: 10px;
23+
resize: vertical;
24+
box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
25+
}
26+
27+
textarea:focus {
28+
outline: none;
29+
border-color: #58a6ff;
30+
box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.3);
31+
background-color: #0d1117;
32+
}
33+
34+
.container {
35+
max-width: 800px;
36+
}
37+
38+
a.github-link {
39+
display: inline-block;
40+
margin-top: 20px;
41+
color: #58a6ff;
42+
text-decoration: none;
43+
font-weight: 500;
44+
}
45+
46+
a.github-link:hover {
47+
text-decoration: underline;
48+
}
49+
50+
.form-check {
51+
margin-bottom: 20px;
52+
}
53+
54+
label {
55+
margin-left: 5px;
56+
}

site/index.html

Lines changed: 40 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,45 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8">
5-
<title>Custom Language → JSON</title>
6-
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
7-
<style>
8-
body {
9-
padding: 50px;
10-
background-color: #0d1117;
11-
color: #c9d1d9;
12-
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
13-
}
14-
15-
h1 {
16-
margin-bottom: 30px;
17-
color: #58a6ff;
18-
}
19-
20-
textarea {
21-
width: 100%;
22-
height: 200px;
23-
margin-bottom: 20px;
24-
font-family: monospace;
25-
background-color: #161b22;
26-
color: #c9d1d9;
27-
border: 1px solid #30363d;
28-
border-radius: 8px;
29-
padding: 10px;
30-
resize: vertical;
31-
box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
32-
}
33-
34-
textarea:focus {
35-
outline: none;
36-
border-color: #58a6ff;
37-
box-shadow: 0 0 0 2px rgba(88,166,255,0.3);
38-
background-color: #0d1117;
39-
}
40-
41-
.container {
42-
max-width: 800px;
43-
}
44-
45-
a.github-link {
46-
display: inline-block;
47-
margin-top: 20px;
48-
color: #58a6ff;
49-
text-decoration: none;
50-
font-weight: 500;
51-
}
52-
53-
a.github-link:hover {
54-
text-decoration: underline;
55-
}
56-
57-
.form-check {
58-
margin-bottom: 20px;
59-
}
60-
61-
label {
62-
margin-left: 5px;
63-
}
64-
</style>
65-
</head>
66-
<body>
67-
<div class="container">
68-
<h1>Custom Language → JSON Converter</h1>
69-
70-
<textarea id="input" placeholder="Write your custom language here..."></textarea>
71-
72-
<!-- Minify checkbox -->
73-
<div class="form-check">
74-
<input class="form-check-input" type="checkbox" value="" id="minify">
75-
<label class="form-check-label" for="minify">Minify JSON output</label>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>JSONH Site</title>
7+
8+
<!-- Bootstrap CSS -->
9+
<link
10+
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
11+
rel="stylesheet"
12+
/>
13+
14+
<link href="index.css" rel="stylesheet"/>
15+
</head>
16+
<body>
17+
<div class="container" id="app">
18+
<h1>JSONH to JSON Converter</h1>
19+
20+
<!-- JSONH Input -->
21+
<h3>JSONH </h3>
22+
<br/>
23+
24+
<textarea id="input" placeholder="Enter JSONH input..."></textarea>
25+
26+
<!-- JSON Output -->
27+
<h3>JSON</h3>
28+
<br/>
29+
30+
<div class="form-check">
31+
<input class="form-check-input" type="checkbox" value="" id="pretty-print">
32+
<label class="form-check-label" for="pretty-print">Pretty Print</label>
33+
</div>
34+
35+
<textarea id="output" placeholder="See JSON output..." readonly></textarea>
36+
37+
<a href="https://github.com/jsonh-org/Jsonh" target="_blank" class="github-link">
38+
View JSONH on GitHub
39+
</a>
7640
</div>
7741

78-
<textarea id="output" placeholder="JSON output..." readonly></textarea>
79-
80-
<a href="https://github.com/yourusername/your-repo" target="_blank" class="github-link">
81-
View this project on GitHub
82-
</a>
83-
</div>
84-
85-
<script type="module" src="./build/main.js"></script>
86-
</body>
42+
<!-- Vite + TypeScript entry -->
43+
<script type="module" src="/src/main.ts"></script>
44+
</body>
8745
</html>

0 commit comments

Comments
 (0)