Permalink
Browse files

Don't publish drafts

  • Loading branch information...
1 parent c48518f commit 6e34c783d43ec0741c164e49e79c24602625f85d @tomafro committed Jan 8, 2013
Showing with 6 additions and 1 deletion.
  1. +2 −1 lib/lanyon/site.rb
  2. +4 −0 lib/lanyon/template.rb
View
@@ -47,7 +47,8 @@ def updated_date_xml
def import
@pages = Dir['**/**'].inject({}) do |contents, path|
unless File.directory?(path) || path.starts_with?('_')
- contents[path] = load_template(path)
+ template = load_template(path)
+ contents[path] = template unless template.respond_to?(:draft?) && template.draft?
end
contents
end
View
@@ -70,6 +70,10 @@ def destination_path
@config[:destination_path] || path
end
+ def draft?
+ @config.has_key?(:draft) && @config[:draft]
+ end
+
def respond_to?(method)
@config.has_key?(method) || super
end

0 comments on commit 6e34c78

Please sign in to comment.