Module: Middleman::BlogPage::Helpers
- Defined in:
- lib/middleman-blog_page/extension_3_0.rb
Overview
Helpers for use within templates and layouts.
Instance Method Summary collapse
-
#blog_page(options = nil) ⇒ BlogPageData
Get the BlogPageData for this site.
-
#blog_pages ⇒ Array<Middleman::Sitemap::Resource>
Returns the list of articles to display on this page.
-
#current_blog_page ⇒ Middleman::Sitemap::Resource
Get a Resource with mixed in BlogArticle methods representing the current article.
- #current_blog_page?(page) ⇒ Boolean
-
#is_blog_page? ⇒ Boolean
Determine whether the currently rendering template is a blog article.
Instance Method Details
#blog_page(options = nil) ⇒ BlogPageData
Get the BlogPageData for this site.
76 77 78 |
# File 'lib/middleman-blog_page/extension_3_0.rb', line 76 def blog_page(=nil) @_blog_page ||= BlogPageData.new(self, ) end |
#blog_pages ⇒ Array<Middleman::Sitemap::Resource>
Returns the list of articles to display on this page.
99 100 101 |
# File 'lib/middleman-blog_page/extension_3_0.rb', line 99 def blog_pages blog_page.pages end |
#current_blog_page ⇒ Middleman::Sitemap::Resource
Get a Resource with mixed in BlogArticle methods representing the current article.
89 90 91 |
# File 'lib/middleman-blog_page/extension_3_0.rb', line 89 def current_blog_page blog_page.page(current_resource.path) end |
#current_blog_page?(page) ⇒ Boolean
93 94 95 |
# File 'lib/middleman-blog_page/extension_3_0.rb', line 93 def current_blog_page?(page) current_blog_page == page end |
#is_blog_page? ⇒ Boolean
Determine whether the currently rendering template is a blog article. This can be useful in layouts.
83 84 85 |
# File 'lib/middleman-blog_page/extension_3_0.rb', line 83 def is_blog_page? !current_blog_page.nil? end |