This repository contains the documentation for Shugur Relay, built with Astro and Starlight.
- Mermaid Diagrams: Interactive diagrams rendered using Playwright and rehype-mermaid
- Responsive Design: Mobile-first documentation with Starlight theme
- Search: Full-text search powered by Pagefind
- Dark/Light Mode: Automatic theme switching
- Node.js 18+ (specified in
.nvmrc
) - npm or yarn
-
Install dependencies:
npm install
This will automatically install Playwright browsers via the postinstall script.
-
Start development server:
npm run dev
The site will be available at
http://localhost:4321
(or next available port). -
Build for production:
npm run build
The documentation uses Mermaid diagrams that are rendered at build time using Playwright. The setup includes:
- rehype-mermaid: Astro plugin for Mermaid rendering
- Playwright: Browser automation for diagram rendering
- Automatic Installation: Browsers are installed via postinstall script
The site is configured for Netlify deployment with:
- Custom Build Script:
scripts/build.sh
handles the build process - Playwright Integration: Browsers are installed during dependency installation
- Optimized Build: Only Chromium browser is installed to reduce build time
- Dependencies: npm installs packages and Playwright browsers
- Build Script:
./scripts/build.sh
runs the Astro build - Output: Static files are generated in the
dist/
directory
netlify.toml
: Netlify deployment configurationastro.config.mjs
: Astro configuration with Mermaid pluginpackage.json
: Dependencies and build scripts.nvmrc
: Node.js version specification.npmrc
: NPM configuration for Playwright
- Playwright Browsers: Ensure browsers are installed via
npx playwright install chromium
- Node Version: Use Node.js 18+ as specified in
.nvmrc
- Dependencies: Clear
node_modules
and reinstall if needed
- Port Conflicts: If port 4321 is in use, Astro will automatically use the next available port
- File Watching: The dev server automatically reloads when files change
- Make changes to the
.mdx
files insrc/content/docs/
- Test locally with
npm run dev
- Ensure the build passes with
npm run build
- Commit and push changes
This documentation is part of the Shugur Relay project.