Project Setup
Project Setup
Section titled “Project Setup”Get your documentation site up and running in minutes. This guide covers everything from initial setup to your first deployment.
Prerequisites
Section titled “Prerequisites”Before starting, ensure you have:
- Node.js 18+ or Bun 1.0+ installed
- Git for version control
- A code editor (VS Code recommended)
Quick Start
Section titled “Quick Start”1. Clone the Repository
Section titled “1. Clone the Repository”git clone https://github.com/yourusername/void.gitcd void2. Install Dependencies
Section titled “2. Install Dependencies”Using Bun (recommended):
bun installUsing npm:
npm install3. Start Development Server
Section titled “3. Start Development Server”bun run devYour site will be available at http://localhost:4321
Project Structure
Section titled “Project Structure”void/├── src/│ ├── assets/ # Images, fonts, and static files│ ├── components/ # Reusable Astro components│ │ ├── override-components/ # Starlight component overrides│ │ └── user-components/ # Custom components│ ├── config/ # Configuration files│ │ ├── config.json # Site metadata│ │ ├── sidebar.json # Navigation structure│ │ ├── menu.en.json # Menu configuration│ │ ├── social.json # Social links│ │ └── locals.json # Localization│ ├── content/│ │ └── docs/ # Documentation content│ │ ├── getting-started/│ │ ├── reference/│ │ └── index.mdx│ └── styles/ # Global CSS styles├── public/ # Static public assets├── astro.config.mjs # Astro configuration└── package.jsonConfiguration
Section titled “Configuration”Site Configuration
Section titled “Site Configuration”Edit src/config/config.json to customize your site:
{ "site": { "title": "Void Documentation", "description": "AppSec research and notes", "logo": "/src/assets/hero-icon.svg", "logo_darkmode": "/src/assets/hero-icon.svg" }, "footer": { "copyright": "Void — AppSec Research" }}Navigation Setup
Section titled “Navigation Setup”Configure sidebar navigation in src/config/sidebar.json:
{ "main": [ { "label": "Documentation", "items": [ { "label": "[seti:vite] Introduction", "autogenerate": { "directory": "getting-started/introduction" } }, ] } ]}Social Links
Section titled “Social Links”Add social links in src/config/social.json:
{ "main": [ { "icon": "github", "label": "GitHub", "href": "https://github.com/yourusername" }, { "icon": "twitter", "label": "Twitter", "href": "https://twitter.com/yourusername" } ]}Creating Content
Section titled “Creating Content”Adding Pages
Section titled “Adding Pages”Create .mdx files in src/content/docs/:
---title: Your Page Titledescription: Brief description for SEO---
# Your Content
Write your documentation here using Markdown and MDX.Using Components
Section titled “Using Components”Import and use custom components:
import Card from "~/components/user-components/NewCard.astro";
<Card title="Feature Card" icon="rocket"> Your card content here</Card>Building for Production
Section titled “Building for Production”Static Build
Section titled “Static Build”bun run buildOutput will be in the dist/ directory.
Preview Production Build
Section titled “Preview Production Build”bun run previewDeploy to Cloudflare Workers
Section titled “Deploy to Cloudflare Workers”bun run deploy:cf-workersDevelopment Workflow
Section titled “Development Workflow”Hot Reload
Section titled “Hot Reload”The development server supports hot reloading. Changes to:
- Content files (
.mdx,.md) → Instant refresh - Components (
.astro) → Fast refresh - Config files → May require restart
Adding Images
Section titled “Adding Images”Place images in src/assets/ and reference them:
Or use the ImageMod component:
import ImageMod from "~/components/ImageMod.astro";
<ImageMod src="/src/assets/your-image.png" alt="Description" width={800} height={400}/>Troubleshooting
Section titled “Troubleshooting”Common Issues
Section titled “Common Issues”Vite module resolution errors
rm -rf .astro node_modules/.vitebun run devBuild fails with content errors
- Check frontmatter syntax in
.mdxfiles - Verify all imported components exist
Styles not applying
- Ensure
global.cssis properly linked inastro.config.mjs - Check Tailwind CSS configuration
For advanced configuration, see the Reference section.