Jekyll — Change layout if page is a post?

Since Jekyll 2.0, you can use Front Matter Defaults:

defaults:
  -
    scope:
      path: ""      # empty string for all files
      type: posts   # limit to posts
    values:
      is_post: true # automatically set is_post=true for all posts

then you can use {{ page.is_post }} to check whether the page is post.

No idea why Jekyll doesn’t set page.type by default.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)