|
| 1 | +# CertForge Static Site |
| 2 | + |
| 3 | +A lightweight Astro site that showcases every CertForge certification domain, links to the open-source prep repositories, and highlights the hands-on demos that live inside each repo. The site is optimized for GitHub Pages or Cloudflare Pages and enforces tests locally and in CI before deployments run. |
| 4 | + |
| 5 | +## Tech Stack |
| 6 | + |
| 7 | +- [Astro](https://astro.build) for the static site |
| 8 | +- TypeScript modules for study-track data |
| 9 | +- [Vitest](https://vitest.dev) for data integrity tests |
| 10 | +- [Husky](https://typicode.github.io/husky) git hooks to block commits when tests fail |
| 11 | +- GitHub Actions workflow for test + deploy to Pages |
| 12 | + |
| 13 | +## Getting Started |
| 14 | + |
| 15 | +```bash |
| 16 | +npm install |
| 17 | +npm run dev |
| 18 | +``` |
| 19 | + |
| 20 | +The dev server runs on `http://localhost:4321` by default. |
| 21 | + |
| 22 | +## Tests |
| 23 | + |
| 24 | +All commits must pass the Vitest suite (a Husky `pre-commit` hook enforces this). |
| 25 | + |
| 26 | +```bash |
| 27 | +npm test # one-off |
| 28 | +npm run test:watch |
| 29 | +``` |
| 30 | + |
| 31 | +The tests verify that each track’s domain weights total 100%, every repo link resolves to the CertForge org, and that each track exposes labs/scripts for the website to promote. |
| 32 | + |
| 33 | +## Deployment |
| 34 | + |
| 35 | +The workflow in `.github/workflows/deploy.yml` handles: |
| 36 | + |
| 37 | +1. `npm ci` |
| 38 | +2. `npm test` |
| 39 | +3. `npm run build` |
| 40 | +4. Upload + deploy to GitHub Pages |
| 41 | + |
| 42 | +The static build artifacts live in `dist/`. Configure Pages to serve from the GitHub Actions workflow output. The same build directory can be uploaded to Cloudflare Pages if desired. |
| 43 | + |
| 44 | +## Project Structure |
| 45 | + |
| 46 | +``` |
| 47 | +├── public/ # Static assets (logos, favicons) |
| 48 | +├── src/ |
| 49 | +│ ├── components/ # Reusable UI blocks (track cards, domains) |
| 50 | +│ ├── data/ # Track/domain metadata used for rendering + tests |
| 51 | +│ ├── layouts/ # Site shell |
| 52 | +│ ├── pages/ # Astro pages |
| 53 | +│ └── styles/ # Global CSS |
| 54 | +├── tests/ # Vitest suites |
| 55 | +└── .husky/ # Git hooks (pre-commit triggers npm test) |
| 56 | +``` |
| 57 | + |
| 58 | +## Contributing |
| 59 | + |
| 60 | +1. Create a branch: `git checkout -b feat/add-track`. |
| 61 | +2. Update the relevant data in `src/data/`. |
| 62 | +3. Run `npm test && npm run lint`. |
| 63 | +4. Commit (the pre-commit hook will re-run `npm test`). |
| 64 | +5. Open a PR describing the update and referencing the source repo. |
0 commit comments