Raga

Raga is a static site generator.

Installation

You need dune, opam, and ocaml to be pre-installed. Then run:

git clone https://github.com/nikochiko/raga
cd raga
opam install .

Usage

Directory Structure

raga works on a directory structure like this:

site/
├── config.huml
├── content/
│   ├── about.md
│   ├── home.md
│   └── posts/
│       ├── first-post.md
│       └── second-post.md
├── templates/
│   │── post.hbs
│   ├── home.hbs
│   └── partials/
│       └── header.hbs
└── static/
    ├── css/
    │   └── styles.css
    └── js/
        └── scripts.js

Configuration

This goes into config.huml:

title: "alice"
base_url: "https://alice.example.com"

pages::
  home::
    src: "home.md"
    dst: "index.html"
    tmpl: "home.hbs"
  rss::
    dst: "rss.xml"
    tmpl: "rss.hbs"
  posts::
    src:: glob: "{**/*,*}.md"
    excl::
      frontmatter:: draft: true
      glob: "{**/_*,_*}.md"
    dst: """
      {{ concat_path (chop_suffix src_path ".md") "index.html" }}
    """
    tmpl: "post.hbs"

params::
  social_links::
    github::
      url: "https://github.com/nikochiko"
      label: "gh/nikochiko"
    email::
      url: "mailto:k@kaustubh.page"
      label: "k@kaustubh.page"
  header_links::
    Home: "/"
    Blog: "/posts/"

Look at examples/blog for a complete example.

CLI

To generate the site, run this command from the root of your site directory:

raga . --output ./_site

The website will be built to the _site directory by default.

LICENSE

MIT.