A modern static site generator for Ruby with Vite/Tailwind integration
Features · Installation · Quick Start · Configuration · How It Works · Integrations
Craze is a static site generator that compiles Markdown content with YAML front matter into a static website using ERB templates. It features incremental builds, live reload during development, and seamless integration with modern frontend tools like Vite and Tailwind CSS.
- Markdown content with YAML front matter
- ERB templates with layouts and partials
- Collections (posts, pages, etc.) with custom permalinks
- Incremental builds with file watching
- Live reload during development
- Vite + Tailwind CSS integration
- Extensible integrations (RSS, Sitemap, Search Index)
Add to your Gemfile:
gem 'craze'Then install:
bundle install- Ruby 3.2+
- Node.js 18+ (for Vite integration)
Create a new project:
craze init mysite
cd mysite
craze devWith Vite + Tailwind:
craze init mysite --with-vite
cd mysite
cd frontend && npm install && cd ..
craze devBuild for production:
craze buildGenerates sitemap.xml with all pages.
Generates feed.xml for posts collection.
Generates search.json for client-side search.
Copies Vite build output to dist directory and provides template helpers.
Create craze.yml in your project root:
| Option | Type | Default | Description |
|---|---|---|---|
site.title |
String | "My Site" |
Site title |
site.url |
String | "https://example.com" |
Site URL |
site.language |
String | "en" |
Site language |
build.out_dir |
String | "dist" |
Output directory |
build.base_path |
String | "/" |
Base path for URLs |
build.clean |
Boolean | true |
Clean output before build |
content.dir |
String | "content" |
Content directory |
templates.dir |
String | "templates" |
Templates directory |
assets.dir |
String | "assets" |
Assets directory |
integrations |
Array | [] |
Enabled integrations |
site:
title: "My Blog"
url: "https://example.com"
language: "en"
build:
out_dir: "dist"
base_path: "/"
clean: true
content:
dir: "content"
collections:
posts:
pattern: "posts//*.md"
permalink: "/posts/:slug/"
templates:
dir: "templates"
integrations:
- sitemap
- rss
- search_index- Content Discovery scans
content/for Markdown files - Front Matter Parsing extracts YAML metadata from each file
- Markdown Rendering converts Markdown to HTML using CommonMark
- Template Rendering applies ERB layouts with page data
- Integration Execution runs sitemap, RSS, search index generators
- Output Writing writes HTML files to
dist/
| Helper | Description |
|---|---|
url_for(path) |
Generate URL with base path |
asset_path(name) |
Generate asset URL |
escape_html(text) |
HTML escape |
format_date(date, format) |
Format date |
| Helper | Description |
|---|---|
vite_client_tag |
Vite HMR client (dev only) |
vite_js_tag(entry) |
JavaScript entry point |
vite_css_tag(entry) |
CSS entry point |
vite_asset_path(entry) |
Get asset path from manifest |
bundle install
bundle exec rake test
bundle exec rubocopBug reports and pull requests are welcome at https://github.com/ydah/craze.
Released under the MIT License.