the public directory site for declared-md. built with Astro, deployed to GitHub Pages at declared-md.github.io.
cd site/
npm install
npm run dev # starts dev server at localhost:4321the dev server starts instantly. search (Pagefind) does not work in dev because the index is only built after npm run build. everything else works.
npm run build # astro build + pagefind indexoutput goes to dist/. Pagefind indexes the HTML in dist/ and writes its index to dist/pagefind/.
to preview the production build locally:
npm run preview # serves dist/ at localhost:4321at build time, the site fetches three JSON files from the declared-md/index repo:
https://raw.githubusercontent.com/declared-md/index/main/data/people.json
https://raw.githubusercontent.com/declared-md/index/main/data/orgs.json
https://raw.githubusercontent.com/declared-md/index/main/data/projects.json
if the remote fetch fails (e.g. the index repo is not yet public, or you're offline), the build continues with empty data. empty states are shown on each directory page.
individual profile pages (/people/:handle, /orgs/:handle, /projects/:handle) are only generated for profiles that appear in the index. if the index is empty, these pages don't exist.
the site uses CSS variables from DESIGN.md. all tokens are defined in src/styles/tokens.css. the Tailwind config extends the default theme with these variables.
dark mode is the default. the user's prefers-color-scheme preference is respected on first visit. preference is saved to localStorage after the first manual toggle.
logos are served from public/assets/. the Logo.astro and landing page components switch between dark and light variants based on the current theme class.
-
new page: add a
.astrofile insrc/pages/. follow the pattern of the existing directory pages. -
new component: add a
.astrofile insrc/components/. use inline CSS variables (style="color:var(--text)") for colors to respect the theme. -
new data field: the data schema is defined in
src/lib/types.ts. helper functions are insrc/lib/data.ts.ProfileDetail.astroshows how to render all known fields. -
new route type: update
src/lib/handle.tsif you need new URL helpers.
the site deploys automatically via GitHub Actions on push to main. the workflow is in .github/workflows/deploy.yml.
it uses the official GitHub Pages Actions:
actions/upload-pages-artifact@v3actions/deploy-pages@v4
to trigger manually: go to the Actions tab and dispatch the deploy workflow.
to rebuild when the index updates, uncomment the repository_dispatch trigger in deploy.yml. the declared-md/index repo can send a dispatch event after each successful crawl.
- design system:
../DESIGN.md - spec:
../spec/ - validator:
../validator/ - indexer:
../index/