Skip to content
qrush edited this page Sep 13, 2010 · 18 revisions

Jekyll traverses your site looking for files to process. Any files with YAML Front Matter are subject to processing. For each of these files, Jekyll makes a variety of data available to the pages via the Liquid templating system. The following is a reference of the available data.

Global

Variable Description
site Sitewide information.
page For Posts, this is the union of the data in the YAML Front Matter and the computed data (such as URL and date). For regular pages, this is just the YAML Front Matter.
content In layout files, this contains the content of the subview(s). In Posts or Pages, this is undefined.

Site

Variable Description
site.time The current Time (when you run the jekyll command).
site.posts A reverse chronological list of all Posts.
site.related_posts If the page being processed is a Post, this contains a list of up to ten related Posts. By default, these are low quality but fast to compute. For high quality but slow to compute results, run the jekyll command with the --lsi (latent semantic indexing) option.
site.categories.CATEGORY The list of all Posts in category CATEGORY.

Post

Variable Description
post.title The title of the Post.
post.url The URL of the Post without the domain. e.g. /2008/12/14/my-post.html
post.date The Date assigned to the Post.
post.id An identifier unique to the Post (useful in RSS feeds). e.g. /2008/12/14/my-post
post.categories The list of categories to which this post belongs. Categories are derived from the directory structure above the posts directory. For example, a post at @/work/code/posts/2008-12-24-closures.textile@ would have this field set to ['work', 'code']. These can also be specified in the YAML Front Matter
post.topics The list of topics for this Post. Topics are derived from the directory structure beneath the _posts directory. For example, a post at /_posts/music/metal/2008-12-24-metalocalypse.textile would have this field set to ['music', 'metal'].
post.content The content of the Post.
Clone this wiki locally