lib/jekyll/post.rb in jekyll-2.0.0.alpha.3 vs lib/jekyll/post.rb in jekyll-2.0.0.rc1
- old
+ new
@@ -54,15 +54,27 @@
self.categories = dir.downcase.split('/').reject { |x| x.empty? }
process(name)
read_yaml(@base, name)
+ data.default_proc = proc do |hash, key|
+ site.frontmatter_defaults.find(File.join(dir, name), type, key)
+ end
+
if data.has_key?('date')
self.date = Time.parse(data["date"].to_s)
end
populate_categories
populate_tags
+ end
+
+ def published?
+ if data.has_key?('published') && data['published'] == false
+ false
+ else
+ true
+ end
end
def populate_categories
if categories.empty?
self.categories = Utils.pluralized_array_from_hash(data, 'category', 'categories').map {|c| c.to_s.downcase}