Skip to content

longcipher/typstify

Repository files navigation

Typstify

typstify

A high-performance static site generator with Typst and Markdown support.

Features

  • πŸš€ Blazing Fast - Built in Rust for maximum performance
  • πŸ“ Dual Format - Write in Markdown or Typst
  • πŸ” Built-in Search - Tantivy powered full-text search with WASM runtime
  • 🌐 Multi-language - First-class i18n support
  • πŸ”„ Live Reload - Instant feedback during development
  • πŸ“Š Syntax Highlighting - 100+ languages supported
  • πŸ“° RSS & Sitemap - Automatic feed generation
  • 🎨 Customizable - Templates, themes, and styles

Installation

From Cargo

cargo install typstify

From Source

git clone https://github.com/longcipher/typstify
cd typstify
cargo install --path bin/typstify

Quick Start

1. Create a New Site

mkdir my-site && cd my-site

2. Create Configuration

Create config.toml:

[site]
title = "My Blog"
base_url = "https://example.com"

[build]
output_dir = "public"

3. Create Content

mkdir -p content/posts
typstify new posts/hello-world

4. Build & Preview

typstify watch --open

Your site is now running at http://127.0.0.1:3000!

Commands

Command Description
typstify build Build the site for production
typstify watch Start dev server with live reload
typstify new <path> Create new content from template
typstify check Validate configuration and content

Build Options

typstify build --output dist    # Custom output directory
typstify build --drafts         # Include draft posts

Watch Options

typstify watch --port 8080      # Custom port
typstify watch --open           # Open browser automatically

Global Options

typstify -c site.toml build     # Custom config file
typstify -v build               # Verbose output
typstify -vvv build             # Debug output

Project Structure

my-site/
β”œβ”€β”€ config.toml         # Site configuration
β”œβ”€β”€ content/            # Content files
β”‚   β”œβ”€β”€ posts/          # Blog posts (Markdown/Typst)
β”‚   β”œβ”€β”€ docs/           # Documentation
β”‚   └── about.md        # Static page
β”œβ”€β”€ templates/          # HTML templates (optional)
β”œβ”€β”€ style/              # CSS/Tailwind (optional)
β”œβ”€β”€ assets/             # Static assets
└── public/             # Generated output

Content Formats

Markdown

---
title: "My Post"
date: 2024-01-15
tags: ["rust", "web"]
---

# Hello World

Your content here...

Typst

// typstify:frontmatter
// title: "Technical Doc"
// date: 2024-01-15

= Introduction

Your Typst content here...

Configuration Reference

See docs/configuration.md for full configuration options.

Basic Configuration

[site]
title = "My Site"
description = "Site description"
base_url = "https://example.com"
default_language = "en"
languages = ["en", "zh"]

[build]
output_dir = "public"
minify = false
syntax_theme = "base16-ocean.dark"
drafts = false

[search]
enabled = true
index_fields = ["title", "body", "tags"]

[rss]
enabled = true
limit = 20

Documentation

Architecture

Typstify is organized as a Cargo workspace:

Crate Description
typstify CLI binary
typstify-core Configuration and content types
typstify-parser Markdown/Typst parsing
typstify-generator HTML generation and build
typstify-search Search indexing (Tantivy)
typstify-search-wasm WASM search runtime
typstify-ui Leptos UI components

Development

Prerequisites

  • Rust 1.75+
  • Bun (for CSS/JS tooling)
  • wasm-pack (for WASM builds)

Setup

git clone https://github.com/longcipher/typstify
cd typstify
just dev

Commands

just format    # Format code
just lint      # Run linters
just test      # Run all tests
just build     # Production build

License

Apache License 2.0 - see LICENSE for details.

Contributing

Contributions are welcome! Please read our Contributing Guide before submitting a PR.