1 unstable release

Uses new Rust 2024

0.1.0 Mar 9, 2026

#58 in #static-site

MIT license

42KB
956 lines

Ducko 🦆

Ducko is a simple, efficient, and fast static site generator (SSG) written in Rust. It aims to provide a streamlined workflow for creating markdown-based websites with live preview and easy deployment.

Features

  • 🚀 Fast Performance: Built with Rust for high-speed site generation.
  • ⚡ Live Reload: Built-in development server with automatic browser refreshing on changes.
  • 📁 Page Bundles: Support for organized page structures with assets.
  • 🎨 Tera Templates: Flexible HTML templating using the Tera engine.
  • 📝 Markdown Support: Write your content in Markdown and let Ducko handle the rest.
  • 🛠️ CLI-First: Intuitive command-line interface for project management.
  • 🔧 Git Integration: Automatic Git repository initialization when starting new projects.

Installation

To install Ducko, simply run:

cargo install ducko

Alternatively, you can build from source:

git clone https://github.com/welon0919/ducko.git
cd ducko
cargo install --path .

Quick Start

1. Initialize a New Project

Run the following command and follow the interactive prompts to set up your site:

ducko new

This will create a new directory with a default skeleton project structure and automatically initialize a Git repository. We highly recommend using Git to track your changes and manage your content history. If Git is not installed, the tool will provide instructions on how to set it up manually.

2. Add a New Page

You can quickly add a new Markdown page:

ducko add "My First Post"

Or create a page bundle (a folder with an index.md and space for related assets):

ducko add "My Awesome Guide" --index

3. Start the Development Server

Run the dev server with live reloading enabled by default:

ducko serve

Your site will be available at http://localhost:3333. Any changes you make to content or templates will automatically refresh the browser.

4. Build for Production

Generate the final static HTML files in the public directory:

ducko build

Project Structure

A typical Ducko project looks like this:

my-site/
├── config.yaml          # Site configuration
├── content/             # Your Markdown content
│   ├── index.md         # Home page
│   └── docs/            # Subdirectories for organization
├── static/              # Static assets (CSS, images, JS)
│   └── style.css
└── templates/           # Tera templates
    ├── base.html
    ├── index.html
    └── post.html

Configuration

The config.yaml file allows you to customize your site:

title: My Awesome Site
description: Generated by Ducko
base_url: http://localhost:3333
language_code: en-US
author:
  name: Your Name
  email: you@example.com
menu:
  - name: Home
    url: /
  - name: Docs
    url: /docs/

Front Matter

Each Markdown file should include a YAML front matter block:

---
title: "My Post Title"
date: "2024-03-08"
template: "post.html"
---

# Your Content Here

License

This project is licensed under the MIT License - see the LICENSE file for details.

Dependencies

~29–50MB
~665K SLoC