Skip to content

stacksjs/bunpress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Social Card of this repo

npm version GitHub Actions Commitizen friendly

BunPress

Fast, modern documentation engine powered by Bun, inspired by VitePress

BunPress is a lightning-fast static site generator designed specifically for documentation. Built on top of Bun's blazing performance with a developer-friendly API inspired by VitePress.

Features

Core Features

  • ⚑ Lightning Fast - ~500ms build time (100 files), 2nd fastest after Hugo
  • πŸ“ Rich Markdown - VitePress-compatible markdown with containers, alerts, code groups, and syntax highlighting
  • πŸ“‹ Smart TOC - Automatic table of contents with filtering, positioning (sidebar/inline/floating), and interactive navigation
  • πŸ› οΈ Developer Friendly - Native TypeScript support, comprehensive CLI (15+ commands), and extensive customization

SEO & Analytics

  • πŸ” Complete SEO - Auto-generated sitemap.xml, robots.txt, Open Graph tags, and JSON-LD structured data
  • πŸ“Š Fathom Analytics - Privacy-focused analytics with GDPR/CCPA compliance and DNT support
  • πŸ”Ž SEO Validation - Built-in SEO checker with auto-fix mode for common issues

Markdown Extensions (VitePress-Compatible)

  • βœ… Custom containers (info, tip, warning, danger, details, raw)
  • βœ… GitHub-flavored alerts (note, tip, important, warning, caution)
  • βœ… Code features (line highlighting, line numbers, focus, diffs, errors/warnings, groups)
  • βœ… Code imports from files with line ranges and regions
  • βœ… Tables with alignment and formatting
  • βœ… Image enhancements with captions and lazy loading
  • βœ… Custom header anchors and inline TOC

Developer Experience

  • πŸš€ Fast Dev Server - ~100ms startup, hot reload, and instant feedback
  • πŸ“¦ Small Bundles - ~45KB per page (HTML + JS + CSS)
  • πŸ’š Low Memory - ~50MB dev server, ~250MB peak for 1000 files
  • 🎯 15+ CLI Commands - Build, dev, preview, stats, doctor, SEO check, and more

Quick Start

Get started with BunPress in seconds:

# Install BunPress
bun add @stacksjs/bunpress

# Create a new documentation site
mkdir my-docs
cd my-docs

# Initialize with basic structure
bunx @stacksjs/bunpress init

# Start development server
bun run dev

# Build for production
bun run build

Basic Usage

Create your first documentation page:

---
title: Welcome
layout: home
---

# Welcome to My Project

This is my awesome project documentation built with BunPress!

## Quick Links

- [Getting Started](/guide/getting-started)
- [API Reference](/api)
- [Examples](/examples)

Configure your site in bunpress.config.ts:

export default {
  title: 'My Documentation',
  description: 'Built with BunPress',
  nav: [
    { text: 'Home', link: '/' },
    { text: 'Guide', link: '/guide' },
    { text: 'API', link: '/api' }
  ],

  // SEO Configuration
  sitemap: {
    enabled: true,
    baseUrl: 'https://mysite.com',
  },
  robots: {
    enabled: true,
  },

  // Analytics
  fathom: {
    enabled: true,
    siteId: 'YOUR_SITE_ID',
    honorDNT: true,
  },
}

CLI Commands

BunPress provides a comprehensive CLI for managing your documentation:

# Development
bunpress dev              # Start dev server with hot reload
bunpress build            # Build for production
bunpress preview          # Preview production build

# Content Management
bunpress new <path>       # Create new markdown file
bunpress init             # Initialize new project

# Maintenance
bunpress clean            # Remove build artifacts
bunpress stats            # Show documentation statistics
bunpress doctor           # Run diagnostic checks

# SEO
bunpress seo:check        # Check SEO for all pages
bunpress seo:check --fix  # Auto-fix SEO issues

# Configuration
bunpress config:show      # Show current configuration
bunpress config:validate  # Validate configuration

Performance Benchmarks

Compared to major documentation generators (100 markdown files):

Generator Build Time Dev Startup Bundle Size Memory
BunPress ~500ms ~100ms ~45KB ~50MB
Hugo ~300ms ~50ms ~10KB ~30MB
VitePress ~2.5s ~800ms ~120KB ~150MB
Docusaurus ~8s ~3s ~250KB ~300MB

BunPress is 5x faster than VitePress and 16x faster than Docusaurus.

See benchmarks/ for detailed comparison.

Testing

bun test              # Run all tests
bun test:quick        # Quick test run (10s timeout)
bun run typecheck     # Type checking
bun run lint          # Lint code

Changelog

Please see our releases page for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Community

For help, discussion about best practices, or any other conversation that would benefit from being searchable:

Discussions on GitHub

For casual chit-chat with others using this package:

Join the Stacks Discord Server

Postcardware

β€œSoftware that is free, but hopes for a postcard.” We love receiving postcards from around the world showing where Stacks is being used! We showcase them on our website too.

Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎

Sponsors

We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.

License

The MIT License (MIT). Please see LICENSE for more information.

Made with πŸ’™

About

πŸ“ Documentation, faster. Coming soon.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

  •  

Contributors 3

  •  
  •  
  •  

Languages