Class: Stic::Page
- Includes:
- Layoutable, Metadata, Renderable
- Defined in:
- lib/stic/page.rb
Instance Attribute Summary
Attributes included from Readable
Attributes included from SiteBase
Instance Method Summary collapse
Methods included from Layoutable
#layout, #layout_name, #render
Methods included from Metadata
Methods included from Renderable
#locals, #render, #render_content, #render_name, #renderer
Methods included from Readable
#content, #initialize, #read, #render, #source_path
Methods inherited from Blob
#mime_type, #relative_target_path, #relative_url, #target_path, #to_s, #write
Methods included from SiteBase
Instance Method Details
#default_layout ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/stic/page.rb', line 26 def default_layout if target_extension == 'html' super else nil end end |
#target_extension ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/stic/page.rb', line 14 def target_extension return data[:format] if data.key?(:format) case path.extensions.first when 'css', 'scss', 'sass', 'styl', 'less' 'css' when 'js', 'coffeescript' 'js' else 'html' end end |
#url_template ⇒ Object
10 11 12 |
# File 'lib/stic/page.rb', line 10 def url_template path.replace_extensions(target_extension).as_absolute end |