A sleek and modern documentation site template built with Astro, Svelte, and Tailwind CSS. Features a clean design, full-text search, dark mode support, and responsive layout.
# Clone the repository
git clone https://github.com/ebenezerdon/docs-template.git
# Navigate to the project
cd docs-template
# Install dependencies
npm install
# Start development server
npm run dev
.
āāā public/
āāā src/
ā āāā assets/
ā āāā components/
ā āāā content/
ā ā āāā docs/
ā ā āāā config.ts
ā āāā layouts/
ā āāā pages/
ā āāā styles/
āāā astro.config.mjs
āāā package.json
āāā tsconfig.json
Add your documentation content in MDX format under src/content/docs/
:
---
title: Getting Started
description: Learn how to use our product
group: Overview
priority: 2
---
# Getting Started
Welcome to our documentation...
The sidebar navigation is automatically generated from your content structure. The order of navigation groups is defined in src/content/config.ts
:
// Define groups in desired order
const groups = ['Overview', 'Foundations', 'Components'] as const
const docs = defineCollection({
type: 'content',
schema: z.object({
title: z.string(),
description: z.string(),
group: z.enum(groups).optional(), // Groups will appear in the order defined above
order: z.number().optional(),
priority: z.number().optional(),
}),
})
Each MDX file can include these frontmatter fields:
Field | Type | Required | Description |
---|---|---|---|
title |
string | Yes | Page title |
description |
string | Yes | Page description |
group |
enum | No | Navigation group (must match config.ts groups) |
priority |
number | No | Navigation order priority (higher = earlier) |
The priority
field gives you fine-grained control over page order within groups:
---
title: Home
group: Overview
priority: 1 # Appears first
---
---
title: Getting Started
group: Overview
priority: 2 # Appears second
---
---
title: Design Tokens
group: Overview
priority: 3 # Appears third
---
If priority
is not set, items are sorted alphabetically by title.
Groups appear in the order they're defined in config.ts
. To change the order of navigation groups:
groups
array in src/content/config.ts
Customize colors, typography, and other design tokens in tailwind.config.mjs
:
theme: {
extend: {
colors: {
primary: {
// Your color palette
}
}
}
}
Add or modify components in src/components/
. The template uses Svelte for interactive components and Astro for page layout.
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
MIT License - feel free to use this template for your own documentation needs.