Jekyll is a blog aware static website generator that is written in Ruby and uses Liquid for templating and Markdown to write posts and pages, Jekyll also offers build in support for SASS, SCSS, LESS and CoffeeScript.

Jekyll follows a naming conversion to differ a post or page. Jekyll knows a specific markdown file is a post when the file is formatted in, if a markdown file is formatted as Jekyll knows it’s a page. You can always use a layout: string in the front-matter to select choose a specific layout or template file to be used while parsing and building a Jekyll based Website.

{% for page in site.pages %} 
{% if page.layout == "custom-page" %} <a href="{{page.url}}">{{page.title}}</a> 
{% endif %} 
{% endfor %}

That is one way to list posts in Liquid. If you want to list a specific layout based page that follows the page naming convention but does not use the layout: as page, we can fix this issue by tweaking the code a bit by adding a if statement to it. We will be using the layout custom-page to separate the stock or default page layout. This small change in the code will list only those pages that use custom-page as layout.

View all posts by Darryl

Darryl is a visual development artist, currently studying Bachelors of Computer Animation at Full Sail University.He writes about, Look development. technical notes and how to get better in life.