Sha256: 55fcb8af141f1f934503eacf4be38690e88bf12f1c9c3a21179e33ed6531fd0e
Contents?: true
Size: 734 Bytes
Versions: 2
Compression:
Stored size: 734 Bytes
Contents
module Octopress class Post < Page def set_default_options @options['type'] ||= 'post' @options['layout'] = @config['new_post_layout'] @options['date'] = convert_date @options['date'] || Time.now @options['extension'] ||= @config['new_post_extension'] @options['template'] ||= @config['new_post_template'] raise "You must specify a title." if @options['title'].nil? end def path name = "#{date_slug}-#{title_slug}.#{extension}" File.join(source, '_posts', name) end # Post template defaults # def default_content <<-TEMPLATE --- layout: {{ layout }} title: {{ title }} date: {{ date }} categories: {{ categories }} --- TEMPLATE end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
octopress-3.0.0.alpha8 | lib/octopress/post.rb |
octopress-3.0.0.alpha7 | lib/octopress/post.rb |