Eager to get started? Now this section assumes that you have lilac installed.
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.
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 = "email@example.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.
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.
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.
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
Each time writing a new post, you just do these steps:
But, from v0.3.7, we have built-in tool ililac, and writing becomes more easy:
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.