Class: Dimples::Sources::Post
Overview
A page from a site with a date.
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#assign_metadata, #initialize, #parse_metadata, #render, #url_for, #write
Constructor Details
This class inherits a constructor from Dimples::Sources::Base
Instance Method Details
#output_directory ⇒ Object
7 8 9 10 11 12 |
# File 'lib/dimples/sources/post.rb', line 7 def output_directory @output_directory ||= File.dirname(@path).gsub( @site.config.source_paths[:posts], @site.config.build_paths[:posts] ).concat("/#{slug}/") end |
#slug ⇒ Object
14 15 16 |
# File 'lib/dimples/sources/post.rb', line 14 def slug File.basename(@path) end |
#template ⇒ Object
18 19 20 |
# File 'lib/dimples/sources/post.rb', line 18 def template @template ||= Tilt::RedcarpetTemplate.new { @contents } end |