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.
16 17 18 19 20 21 22 23 |
# File 'lib/middleman-blog-drafts/blog_data_extensions.rb', line 16 def draft(path) article = @app.sitemap.find_resource_by_path(path.to_s) if article && article.is_a?(BlogArticle) article else nil end end |