move related_posts into site data

This commit is contained in:
Tom Preston-Werner 2008-12-14 14:58:03 -08:00
parent 0c270cb1e5
commit d48157cf33
2 changed files with 7 additions and 7 deletions

View File

@ -76,11 +76,6 @@ h3. Global
In layout files, this contains the content of the subview(s). In Posts or In layout files, this contains the content of the subview(s). In Posts or
pages, this is undefined. pages, this is undefined.
related_posts
If the page being processed is a Post, this contains a list of up to ten
related Posts. For high quality results be sure to run the jekyll command
with the --lsi option.
h3. Site h3. Site
site.time site.time
@ -89,6 +84,11 @@ h3. Site
site.posts site.posts
A reverse chronological list of Posts A reverse chronological list of Posts
site.related_posts
If the page being processed is a Post, this contains a list of up to ten
related Posts. For high quality results be sure to run the jekyll command
with the --lsi option.
h3. Post h3. Post
post.title post.title

View File

@ -121,8 +121,8 @@ module Jekyll
def add_layout(layouts, site_payload) def add_layout(layouts, site_payload)
# construct post payload # construct post payload
related = related_posts(site_payload["site"]["posts"]) related = related_posts(site_payload["site"]["posts"])
payload = {"page" => self.to_liquid.merge(self.data), "related_posts" => related} payload = {"page" => self.to_liquid.merge(self.data)}
do_layout(payload, layouts, site_payload) do_layout(payload, layouts, site_payload.merge({"site" => {"related_posts" => related}}))
end end
# Write the generated post file to the destination directory. # Write the generated post file to the destination directory.