What's the difference between Jekyll Posts, Pages, and Documents?

April 15th, 2017


To those hooking into the internals of Jekyll, knowing a bit more about what each variable includes can be helpful.

site.pages only returns pages.1 site.posts returns documents in your _posts directory. site.collections returns all collections. site.documents returns all documents across all collections, including posts.

module JekyllPushPress
  class Generator < Jekyll::Generator
    safe true
    priority :lowest

    def generate(site)
      # Insert code here.
    end
  end
end
  1. To run any of these snippets, create _plugins/test.rb and run bundle exec jekyll build