Skip to content
lepture edited this page Oct 26, 2011 · 5 revisions

Template

By default, liquidluck create 5 templates:

  • layout.html
  • archive.html
  • post.html
  • tagcloud.html
  • feed.xml

Template use jinja as the engine. You should take a look at jinja's documentation.

You may want to write your own theme, but before that you could take a look at the theme gallery .

Variables

Common variables that can be used in every template:

  • context : context is defined in your configure file. e.g. {{ context.author }}
  • status : status of your blog.
    • status.years (list) if you enabled YearWriter
    • status.tags (list) if you enabled TagWriter
    • status.folders (list) if you enabled FolderWriter
  • content_url: this is a function, which create a post url according to slug defined in your configure file. see Configure e.g. {{ content_url(post.slug) }}
  • static_url: this is a function, which create a static file url. The output will be like /_static/style.css?t=12345, so you don't need to worry about static cache. e.g. {{ static_url('css/style.css') }}

post.html

Every single post, use this template.

Available variable is post.

post contain everything of your post. e.g.

  • post.title
  • post.content
  • post.tags
  • post.date
  • post.slug

And other variables you defined in meta data, see Write

One more thing, post has two more variables: prev and next, and they are post too, which means you can use

  • post.prev.title
  • post.prev.content
  • post.next.slug

etc.

archive.html

Available variables:

  • title : title of this page
  • pager

pager

  • posts : a list of posts for current page
  • pages : pages number (how many pages of all posts)
  • page : current page number
  • prev : previous page number
  • next : next page number
  • folder : current page's folder
  • sub_folder : current page's subfolder

tagcloud.html

The only Variables: tags, just check the default template.

Clone this wiki locally