Class: Jekyll::ConvertiblePartial

Inherits:
Object
  • Object
show all
Includes:
Convertible
Defined in:
lib/octopress-hooks.rb

Overview

Create a new page class to allow partials to trigger Jekyll Page Hooks.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Convertible

#do_layout, #full_url, #is_convertible_partial?, #is_filterable?, #is_page?, #is_post?, #old_do_layout, #old_transform, #old_write, #post_render, #post_write, #pre_render, #transform, #write

Constructor Details

#initialize(site, name, content) ⇒ ConvertiblePartial

Returns a new instance of ConvertiblePartial.



147
148
149
150
151
152
153
154
# File 'lib/octopress-hooks.rb', line 147

def initialize(site, name, content)
  @site     = site
  @name     = name
  @ext      = File.extname(name)
  @content  = content
  @data     = { layout: "no_layout" } # hack
  
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



145
146
147
# File 'lib/octopress-hooks.rb', line 145

def content
  @content
end

#dataObject

Returns the value of attribute data.



145
146
147
# File 'lib/octopress-hooks.rb', line 145

def data
  @data
end

#extObject

Returns the value of attribute ext.



145
146
147
# File 'lib/octopress-hooks.rb', line 145

def ext
  @ext
end

#nameObject

Returns the value of attribute name.



145
146
147
# File 'lib/octopress-hooks.rb', line 145

def name
  @name
end

#outputObject

Returns the value of attribute output.



145
146
147
# File 'lib/octopress-hooks.rb', line 145

def output
  @output
end

#siteObject

Returns the value of attribute site.



145
146
147
# File 'lib/octopress-hooks.rb', line 145

def site
  @site
end

Instance Method Details

#render(payload) ⇒ Object



156
157
158
# File 'lib/octopress-hooks.rb', line 156

def render(payload)
  do_layout(payload, { no_layout: nil })
end