#post #blog #generator

bin+lib sonata

The static site generator

Show the crate…

8 releases

new 0.1.7 Apr 2, 2025
0.1.6 Apr 2, 2025
0.1.0 May 24, 2019

#79 in #post

GPL-3.0-only

1MB
22K SLoC

JavaScript 19K SLoC // 0.1% comments TypeScript 2K SLoC // 0.1% comments Rust 824 SLoC // 0.0% comments Handlebars 78 SLoC // 0.1% comments

sonata

sonata ci

Usage

cargo install sonata
sonata init blog
sonata serve blog

The minimal directory layout is like below, see sonata.toml for the full configuration.

my-blog
├── sonata.toml
└── posts
    └── 2024-01-01-hello-world.md

Github Action

name: sonata

on:
  push:
    branches: [main]

jobs:
  deploy:
    name: Deploy
    runs-on: ubuntu-22.04
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v4
      - uses: clearloop/sonata@0.0.7

      - name: Build the site
        run: sonata build blog

      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./blog/out

LICENSE

GPL-3.0-only

Dependencies

~11–24MB
~335K SLoC