Module: Middleman::Blog::Drafts::BlogDataExtensions
- Defined in:
- lib/middleman-blog-drafts/blog_data_extensions.rb
Overview
An extension to let BlogData know about all draft articles in the site.
Instance Method Summary collapse
-
#draft(path) ⇒ Middleman::Sitemap::Resource
A draft BlogArticle for the given path, or nil if one doesn’t exist.
- #drafts(app = nil, options = nil) ⇒ Object
Instance Method Details
#draft(path) ⇒ Middleman::Sitemap::Resource
A draft BlogArticle for the given path, or nil if one doesn’t exist.
13 14 15 16 17 18 19 20 |
# File 'lib/middleman-blog-drafts/blog_data_extensions.rb', line 13 def draft(path) article = @app.sitemap.find_resource_by_path(path.to_s) if article && article.is_a?(BlogArticle) article else nil end end |
#drafts(app = nil, options = nil) ⇒ Object
7 8 9 |
# File 'lib/middleman-blog-drafts/blog_data_extensions.rb', line 7 def drafts(app=nil, =nil) @_drafts ||= Middleman::Blog::Drafts::Data.new(self, app, ) end |