forked from avelino/liquidluck
-
Notifications
You must be signed in to change notification settings - Fork 0
Template
lepture edited this page Oct 26, 2011
·
5 revisions
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 .
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 toslugdefined 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') }}
Every single post, use this template.
Available variable is post.
post contain everything of your post. e.g.
post.titlepost.contentpost.tagspost.datepost.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.titlepost.prev.contentpost.next.slug
etc.
Available variables:
-
title: title of this page 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
The only Variables: tags, just check the default template.