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.