diff --git a/lib/jekyll/post.rb b/lib/jekyll/post.rb index 914cfd59..a86f31a2 100644 --- a/lib/jekyll/post.rb +++ b/lib/jekyll/post.rb @@ -47,26 +47,10 @@ module Jekyll self.published = true end - if self.data.has_key?("tag") - self.tags = [self.data["tag"]] - elsif self.data.has_key?("tags") - self.tags = self.data['tags'] - else - self.tags = [] - end + self.tags = self.data.pluralized_array("tag", "tags") if self.categories.empty? - if self.data.has_key?('category') - self.categories << self.data['category'] - elsif self.data.has_key?('categories') - # Look for categories in the YAML-header, either specified as - # an array or a string. - if self.data['categories'].kind_of? String - self.categories = self.data['categories'].split - else - self.categories = self.data['categories'] - end - end + self.categories = self.data.pluralized_array('category', 'categories') end end