diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 4e337e96..46d64d3a 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -47,14 +47,8 @@ module Jekyll self.published = self.is_published - self.tags = self.data.pluralized_array("tag", "tags") - - if self.categories.empty? - self.categories = self.data.pluralized_array('category', 'categories').map {|c| c.downcase} - end - - self.tags.flatten! - self.categories.flatten! + self.setup_categories + self.setup_tags end def is_published @@ -65,6 +59,18 @@ module Jekyll end end + def setup_categories + if self.categories.empty? + self.categories = self.data.pluralized_array('category', 'categories').map {|c| c.downcase} + end + self.categories.flatten! + end + + def setup_tags + self.tags = self.data.pluralized_array("tag", "tags") + self.tags.flatten! + end + # Get the full path to the directory containing the post files def containing_dir(source, dir) return File.join(source, dir, '_posts')