Skip to content

Commit dcf85e4

Browse files
authored
Merge pull request #4 from TheProfs/fix/static-html
fix: drop ruby/rewrite in static html
2 parents b3520c5 + ee7106b commit dcf85e4

39 files changed

Lines changed: 2035 additions & 1532 deletions

.gitattributes

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

.github/CONTRIBUTING.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Contributing
2+
3+
## HTML
4+
5+
- Semantic elements over generic `div`/`span`
6+
- Minimal wrappers; avoid nesting without purpose
7+
- Minimal classes; prefer element and attribute selectors
8+
- ARIA attributes where native semantics fall short
9+
- No inline styles; keep presentation in CSS
10+
- Use `<code-block lang="...">` for fenced code examples
11+
12+
## CSS
13+
14+
- Native CSS nesting; no preprocessors
15+
- `light-dark()` for theming via `color-scheme`
16+
- CSS custom properties for shared values
17+
- Specific `transition` properties, not `all`
18+
- Gate motion behind `prefers-reduced-motion`
19+
- Mobile breakpoint at `768px`
20+
21+
## JavaScript
22+
23+
- Functional style; `const`, arrow functions, expressions
24+
- Minimal intermediates; prefer composition
25+
- No frameworks or external dependencies
26+
- Handle async errors (e.g. `.catch` on clipboard)
27+
- No DOM writes from user input without escaping
28+
29+
## General
30+
31+
- Avoid dependencies if possible; prefer `npx` for external tools
32+
- Single file; CSS and JS are embedded in `index.html`
33+
- Keep the page under 1000 lines total
34+
- Test in both light and dark mode
35+
- Verify mobile layout before committing
36+
- Fix lint warnings in prose, not in the linter config
37+
38+
## Server
39+
40+
### Add a new page
41+
42+
1. Place an `.html` file in the project root
43+
2. Register it in `app.js`: `.get('/path', 'file.html')`
44+
45+
### Serve custom content
46+
47+
1. Add a text route in `app.js`: `.get('/path', 'body')`
48+
49+
Omit the body to respond with `ok`: `.get('/health')`
50+
51+
### Serve static files
52+
53+
1. Place files in a directory (e.g. `assets/`)
54+
2. Register in `app.js`: `.static('/assets')`
55+
56+
### Notes
57+
58+
- Only `GET` requests; everything else returns `405`
59+
- File extensions must have a known MIME type (see `Server.DEFAULTS.mime`)
60+
- Pages are loaded into memory at startup; restart to pick up changes
61+
- Static directories must be within the project root
62+
- `index.html` at root is auto-detected and served at `/`

.github/workflows/test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v6
14+
- uses: actions/setup-node@v6
15+
with:
16+
node-version: 24
17+
- run: npm test

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules/
2-
*.DS_STORE
2+
.DS_Store
33
tmp
4+
.claude/

CHANGELOG.md

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

0 commit comments

Comments
 (0)