Lilac

Quick Start

Eager to get started? Now this section assumes that you have lilac installed.

Create a New Blog

You need to create a new directory for your new blog, and then run lilac deploy in the empty directory:

$ mkdir MyBlog
$ cd MyBlog
$ lilac deploy

You may want to run ls to see what has happened:

$ ls
classic  config.toml  Makefile  src  venv

After this step, lilac generates you a sample config file config.toml, a sample post file src/post/sample.md, and the default theme classic.

And, lilac generates a Makefile to manage blog.

Now, what to do next is configuring our fresh blog.

Configure your Blog

The configuration is dead minimal, let’s take a look at the config.toml:

root_path = ""

[blog]
name = "Make Difference"
description = "Here goes your blog's description"
url = "http://your-blog.org"
theme = "classic"

[author]
name = "me"
email = "me@some.com"

[disqus]
shortname = "your-disqus-short-name"

[theme.vars]
github = "your-github-username"

The configuration is in TOML, but you really needn’t to learn this language, it is obvious and simple.

Now you need to edit the sample configuration generated by lilac.

Note: You need to set ‘root_path’ only if you are deploying your blog to sub_directory

To learn more about configuration, see also configuration.

Choose a Theme

Don’t like the built-in theme? Go to the theme list to choose one.

Just clone the theme repo down, for example, the theme less:

$ git clone git://github.com/hit9/lilac-theme-less.git less

and then set “theme” to “less” in config.toml:

theme = "less"

See themes to learn more.

Create a New Post

Each time your start with a new post, you need to touch a new file under directory src/post:

$ vim src/post/Hello-World.md

Here is a sample post:

title = "Hello World!"
datetime = "2013-06-05 17:12"
-------
# Hello World!

You can go to Post’s Syntax to learn more.

Build Site

You can fire up another shell to run lilac’s server:

$ make serve

This command will start a web server here and tell lilac to start watch file changes - once you update source files, lilac will auto rebuild the blog.

To see build results in action, point your browser at http://localhost:8888

For more about building server, see command serve

Writing Steps

Each time writing a new post, you just do these steps:

  1. activate the environment if you install lilac in virtualenv.
  2. run lilac’s server.
  3. touch a new file under src/post/ and then start writing.
  4. see results in browser after doing a save.

But, from v0.3.7, we have built-in tool ililac, and writing becomes more easy:

Use Deamon

We can run lilac’s server and rebuilder in the background, each time we start writing, just:

$ cd myblog
$ lilac start

remember to stop the daemon when finish writing:

$ lilac stop

We just need at most one shell session to blog.

What’s Next?

I think reading these will be very helpful: Post Syntax, Commands, Configuration.

***
Fork me on GitHub