mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
pages now present in the site payload and can be used through the site.pages variable
This commit is contained in:
@@ -75,10 +75,19 @@ module Jekyll
|
||||
#
|
||||
# Returns nothing
|
||||
def render(layouts, site_payload)
|
||||
payload = {"page" => self.data}.deep_merge(site_payload)
|
||||
payload = {
|
||||
"page" => self.to_liquid
|
||||
}.deep_merge(site_payload)
|
||||
|
||||
do_layout(payload, layouts)
|
||||
end
|
||||
|
||||
def to_liquid
|
||||
self.data.deep_merge({
|
||||
"url" => self.url,
|
||||
"content" => self.content })
|
||||
end
|
||||
|
||||
# Write the generated page file to the destination directory.
|
||||
# +dest_prefix+ is the String path to the destination dir
|
||||
# +dest_suffix+ is a suffix path to the destination dir
|
||||
|
||||
@@ -167,12 +167,10 @@ module Jekyll
|
||||
# Returns nothing
|
||||
def render(layouts, site_payload)
|
||||
# construct payload
|
||||
payload =
|
||||
{
|
||||
payload = {
|
||||
"site" => { "related_posts" => related_posts(site_payload["site"]["posts"]) },
|
||||
"page" => self.to_liquid
|
||||
}
|
||||
payload = payload.deep_merge(site_payload)
|
||||
}.deep_merge(site_payload)
|
||||
|
||||
do_layout(payload, layouts)
|
||||
end
|
||||
|
||||
@@ -230,11 +230,13 @@ module Jekyll
|
||||
#
|
||||
# Returns {"site" => {"time" => <Time>,
|
||||
# "posts" => [<Post>],
|
||||
# "pages" => [<Page>],
|
||||
# "categories" => [<Post>]}
|
||||
def site_payload
|
||||
{"site" => self.config.merge({
|
||||
"time" => self.time,
|
||||
"posts" => self.posts.sort { |a,b| b <=> a },
|
||||
"pages" => self.pages,
|
||||
"categories" => post_attr_hash('categories'),
|
||||
"tags" => post_attr_hash('tags')})}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user