mdbear-0.1.0 is not a library.
mdBear
A fast static site generator inspired by Bear Blog, written in Rust. Create beautiful, lightweight websites from Markdown files with customizable themes.
Features
- Generate static sites from Markdown files with YAML frontmatter
- Support for both pages and blog posts with date-based ordering
- Customizable themes using Tera templating engine
- Built-in development server with live preview
- Asset copying for images, CSS, JavaScript, and other resources
- Simple initialization command to get started quickly
Installation
Install from crates.io:
Or build from source:
Usage
Initialize a new site
This creates a new directory with the default structure:
config.toml- Site configurationcontent/- Markdown content filestheme/- HTML templates
Build the site
Options:
-c, --config <CONFIG>- Configuration file (default: "config.toml")
Serve with live preview
Options:
-p, --port <PORT>- Port to serve on (default: 3000)-c, --config <CONFIG>- Configuration file (default: "config.toml")
Configuration
The config.toml file defines your site structure:
= ":-)"
= "My Site"
= "Your Name"
= "dist"
[[]]
= "Home"
= "index.md"
= "page"
[[]]
= "Blog"
= "blog"
= "blog"
Navigation types:
page- Individual pages like "About", "Contact"blog- Collections of blog posts organized by datelink- External links
Content Format
Pages and blog posts use Markdown with YAML frontmatter:
---
title: My Blog Post
date:
---
# My Content
This is my blog post content in Markdown.
Theme System
mdBear uses Tera templates for theming. The default theme includes:
page.html- Template for individual pageslist.html- Template for blog index pages
License
MIT