Create a site with an example pages, posts, and layouts:

# Create site in current directory
$ cobalt init
# Create site in `myBlog` sub-directory
$ cobalt init myBlog


Serve your site at

$ cobalt serve
# Include drafts
$ cobalt serve --drafts

This provides live reload; it will re-generate your site as you add or change content.


Add a new page or post to your site:

# Creates page `` in the current directory
$ cobalt new "Cats Around the World"
# Creates post `` in the `posts` directory
$ cobalt new "Cats Around the World" --file posts
# Creates post `` in the `posts` directory
$ cobalt new "Cats Around the World" --file posts/

You can modify the template used for new by editing the files in _defaults.


Once your post is ready, you can publish it:

$ cobalt publish posts/

The page will no longer be a "draft" and the published_date will be set to today.

You can also publish from the drafts folder:

$ cobalt publish drafts/

It will move it to posts folder besides changing "draft" status and published_date.

For posts, by default, the date (YYYY-MM-DD-) will be prepend to your posts filename in order to keep them in a chronological order. This can be turn off in the configuration (see publish_date_in_filename). This setting is disabled for pages (and can be turn on in configuration).


Once the states of your documents are in a position to be put online − by using publish on the documents you want to make visible, or manually setting is_draft: false − it's time to build the website:

$ cobalt build

All the documents not in draft state will be build into a html file ready to be serve by your web server.


To see all the available commands, run

$ cobalt --help

You can then get help with those commands by running

$ cobalt <command> --help