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
-
To run any of these snippets, create
_plugins/test.rb
and runbundle exec jekyll build
. ↩