From 4c05729adc1630786c2f6bc5a2f4f49577aa39b2 Mon Sep 17 00:00:00 2001 From: remi Date: Sat, 20 Dec 2008 12:45:30 -0700 Subject: [PATCH 1/2] made post's YAML front matter available as post.data --- lib/jekyll/post.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index caca9354..1d2bbb79 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -146,7 +146,8 @@ module Jekyll "url" => self.url, "date" => self.date, "id" => self.id, - "content" => self.content } + "content" => self.content, + "data" => self.data } end end From 6d8c73349e2e05529a3e4f7b27dd808070b7ab0e Mon Sep 17 00:00:00 2001 From: remi Date: Sat, 20 Dec 2008 12:53:07 -0700 Subject: [PATCH 2/2] merged Post's YAML front matter into its to_liquid payload, just like Page does. allows {{ page.arbitrary_yaml_data }} (cleaner than {{ page.data['arbitrary_yaml_data'] }}) --- lib/jekyll/post.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 1d2bbb79..66a8eef6 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -142,12 +142,11 @@ module Jekyll # # Returns def to_liquid - { "title" => self.data["title"] || "", + self.data.merge({ "title" => self.data["title"] || "", "url" => self.url, "date" => self.date, "id" => self.id, - "content" => self.content, - "data" => self.data } + "content" => self.content }) end end