Class: Jekyll::ConvertiblePartial
- Inherits:
-
Object
- Object
- Jekyll::ConvertiblePartial
- Includes:
- Convertible
- Defined in:
- lib/jekyll-page-hooks.rb
Overview
Create a new page class to allow partials to trigger Jekyll Page Hooks.
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#data ⇒ Object
Returns the value of attribute data.
-
#ext ⇒ Object
Returns the value of attribute ext.
-
#name ⇒ Object
Returns the value of attribute name.
-
#output ⇒ Object
Returns the value of attribute output.
-
#site ⇒ Object
Returns the value of attribute site.
Instance Method Summary collapse
-
#initialize(site, name, content) ⇒ ConvertiblePartial
constructor
A new instance of ConvertiblePartial.
- #render(payload) ⇒ Object
Methods included from Convertible
#do_layout, #full_url, #is_convertible_partial?, #is_filterable?, #is_page?, #is_post?, #old_do_layout, #old_transform, #post_render, #post_write, #pre_render, #transform
Constructor Details
#initialize(site, name, content) ⇒ ConvertiblePartial
Returns a new instance of ConvertiblePartial.
88 89 90 91 92 93 94 95 |
# File 'lib/jekyll-page-hooks.rb', line 88 def initialize(site, name, content) @site = site @name = name @ext = File.extname(name) @content = content @data = { layout: "no_layout" } # hack end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
86 87 88 |
# File 'lib/jekyll-page-hooks.rb', line 86 def content @content end |
#data ⇒ Object
Returns the value of attribute data.
86 87 88 |
# File 'lib/jekyll-page-hooks.rb', line 86 def data @data end |
#ext ⇒ Object
Returns the value of attribute ext.
86 87 88 |
# File 'lib/jekyll-page-hooks.rb', line 86 def ext @ext end |
#name ⇒ Object
Returns the value of attribute name.
86 87 88 |
# File 'lib/jekyll-page-hooks.rb', line 86 def name @name end |
#output ⇒ Object
Returns the value of attribute output.
86 87 88 |
# File 'lib/jekyll-page-hooks.rb', line 86 def output @output end |
#site ⇒ Object
Returns the value of attribute site.
86 87 88 |
# File 'lib/jekyll-page-hooks.rb', line 86 def site @site end |
Instance Method Details
#render(payload) ⇒ Object
97 98 99 |
# File 'lib/jekyll-page-hooks.rb', line 97 def render(payload) do_layout(payload, { no_layout: nil }) end |