From d48157cf33ac06b5a5466b75c3d759d09f7d5a38 Mon Sep 17 00:00:00 2001 From: Tom Preston-Werner Date: Sun, 14 Dec 2008 14:58:03 -0800 Subject: [PATCH] move related_posts into site data --- README.textile | 10 +++++----- lib/jekyll/post.rb | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.textile b/README.textile index 6e1efa63..bc045bf6 100644 --- a/README.textile +++ b/README.textile @@ -76,11 +76,6 @@ h3. Global In layout files, this contains the content of the subview(s). In Posts or 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 site.time @@ -89,6 +84,11 @@ h3. Site site.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 post.title diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 756df267..caca9354 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -121,8 +121,8 @@ module Jekyll def add_layout(layouts, site_payload) # construct post payload related = related_posts(site_payload["site"]["posts"]) - payload = {"page" => self.to_liquid.merge(self.data), "related_posts" => related} - do_layout(payload, layouts, site_payload) + payload = {"page" => self.to_liquid.merge(self.data)} + do_layout(payload, layouts, site_payload.merge({"site" => {"related_posts" => related}})) end # Write the generated post file to the destination directory.