Sign in

    moonblox

    MoonBit-native programmable site generator with interactive components

    markdown
    ssg
    composable
    rabbita
    Download zip
    Author
    Version
    0.1.0
    License
    Apache-2.0
    Last updated
    3 months ago
    Downloads
    32

    @badge(text: "new", tone: "info") @counter(value: 0) :::callout(type: "note", title: "Tip") Your Markdown content here. ::: ::score_panel { count = 0 } @metric(value=count, label="Clicks") @chart(value=count, max=10, label="Progress") @counter(value=count) ::

    #Features

    • Front matter: YAML metadata (title, date, tags) rendered in page output
    • Tables: Markdown table support with alignment
    • 8 built-in components: badge, counter, callout, card, grid, metric, chart, graph
    • Configuration: moonblox.json for custom input/output/component paths
    • Live reload: moonblox-cli serve with file watcher and WebSocket reload
    • Incremental builds: Dev server skips unchanged files, uses debug builds

    #Quick Start

    Requires MoonBit toolchain.

    moon install xz-xuezhe/moonblox-cli

    moonblox-cli init my-site cd my-site moonblox-cli serve # dev server with live reload moonblox-cli build # production build

    #Documentation

    Read the full documentation at https://xz-xuezhe.github.io/moonblox/.

    #Project Structure

    my-site/ posts/index.md # your Markdown content components/ — your components (8 built-in: badge, counter, callout, card, grid, metric, chart, graph) theme/base.css # global styles dist/ # built output

    #Components

    Use built-in or project-local components directly from Markdown:

    @badge(text: "stable", tone: "success") :::callout(type: "note", title: "Tip") Markdown content can live inside container components. :::

    For custom component authoring and the MoonBit interface details, see https://xz-xuezhe.github.io/moonblox/components/.

    #Structured Block Syntax

    Use ::name { model } body :: to share state between components:

    ::dashboard { count = 0 } @metric(value=count, label="Clicks") @chart(value=count, max=10, label="Progress") @counter(value=count) ::

    Here, counter updates count; metric and chart read the same value and re-render when it changes. Interactive components auto-wire callbacks to update the shared model.

    #Dependencies

    #CLI Commands

    • moonblox-cli init <dir> — scaffold a new project
    • moonblox-cli build <dir> — build static site to dist/
    • moonblox-cli serve <dir> [--port 3000] — start dev server with live reload

    #License

    Source Files