<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -114,7 +114,7 @@ module Jekyll
           transform_pages(File.join(dir, f))
         else
           first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }
-          
+
           if first3 == &quot;---&quot;
             # file appears to have a YAML header so process it as a page
             page = Page.new(self.source, dir, f)
@@ -128,21 +128,29 @@ module Jekyll
         end
       end
     end
-    
+
+    # Constructs a hash map of Posts indexed by the specified Post attribute
+    #
+    # Returns {post_attr =&gt; [&lt;Posts&gt;]}
+    def post_attr_hash(post_attr)
+      # Build a hash map based on the specified post attribute ( post attr =&gt; array of posts )
+      # then sort each array in reverse order
+      hash = Hash.new { |hash, key| hash[key] = Array.new }
+      self.posts.each { |p| p.send(post_attr.to_sym).each { |t| hash[t] &lt;&lt; p } }
+      hash.values.map { |sortme| sortme.sort! { |a, b| b &lt;=&gt; a} }
+      return hash
+    end
+
     # The Hash payload containing site-wide data
     #
-    # Returns {&quot;site&quot; =&gt; {&quot;time&quot; =&gt; &lt;Time&gt;, &quot;posts&quot; =&gt; [&lt;Post&gt;]}}
+    # Returns {&quot;site&quot; =&gt; {&quot;time&quot; =&gt; &lt;Time&gt;, &quot;posts&quot; =&gt; [&lt;Post&gt;], &quot;categories&quot; =&gt; [&lt;Categories&gt;], &quot;topics&quot; =&gt;
+    # [&lt;Topics&gt;] }}
     def site_payload
-      # Build the category hash map of category ( names =&gt; arrays of posts )
-      # then sort each array in reverse order
-      categories = Hash.new { |hash, key| hash[key] = Array.new }
-      self.posts.each { |p| p.categories.each { |c| categories[c] &lt;&lt; p } }
-      categories.values.map { |cats| cats.sort! { |a, b| b &lt;=&gt; a} }
-      
       {&quot;site&quot; =&gt; {
         &quot;time&quot; =&gt; Time.now, 
         &quot;posts&quot; =&gt; self.posts.sort { |a,b| b &lt;=&gt; a },
-        &quot;categories&quot; =&gt; categories
+        &quot;categories&quot; =&gt; post_attr_hash('categories'),
+        &quot;topics&quot; =&gt; post_attr_hash('topics')
       }}
     end
   end</diff>
      <filename>lib/jekyll/site.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e7b2df11563180e3397ae46e97212ab34039868d</id>
    </parent>
  </parents>
  <author>
    <name>Basil Shkara</name>
    <login></login>
    <email>basil@armin.localdomain</email>
  </author>
  <url>http://github.com/baz/jekyll/commit/60b81d8a8d967f5e8afb0c323ffeca71897b61dd</url>
  <id>60b81d8a8d967f5e8afb0c323ffeca71897b61dd</id>
  <committed-date>2008-12-26T16:06:25-08:00</committed-date>
  <authored-date>2008-12-26T16:06:25-08:00</authored-date>
  <message>Added new accessible Liquid attribute for Sites: .topics.
Behaves like the .categories attribute.</message>
  <tree>8ceb4a0561b5810961717dadc5683fe17de4d808</tree>
  <committer>
    <name>Basil Shkara</name>
    <login></login>
    <email>basil@armin.localdomain</email>
  </committer>
</commit>
