vendor/cache/ruby/2.1.0/gems/octopress-3.0.0.rc.34/lib/octopress/draft.rb
# Create a new post from draft file
#
# Sets post options based on draft file contents
# and options passed to the publish command
#
Create a new post from draft file
Sets post options based on draft file contents
and options passed to the publish command
Create a new post from draft file Sets post options based on draft file contents and options passed to the publish command
def publish
      @options['date'] ||= read_post_yaml('date') || Time.now.iso8601
      @options['title'] = read_post_yaml('title')
      post_options = {
        'title'   => @options['title'],
        'date'    => @options['date'],
        'slug'    => title_slug,
        'content' => read_post_content,
        'dir'     => @options['dir'],
        'type'    => 'post from draft'
      }
      Post.new(site, post_options).write
       Remove the old draft file
      FileUtils.rm @options['path']
    end
def publish @options [ 'date' ] ||= read_post_yaml ( 'date' ) || Time . now . iso8601 @options [ 'title' ] = read_post_yaml ( 'title' ) post_options = { 'title' => @options [ 'title' ] , 'date' => @options [ 'date' ] , 'slug' => title_slug , 'content' => read_post_content , 'dir' => @options [ 'dir' ] , 'type' => 'post from draft' } Post . new ( site , post_options ) . write FileUtils . rm @options [ 'path' ] end
Create a new post from draft file
Sets post options based on draft file contents
and options passed to the publish command
Create a new post from draft file Sets post options based on draft file contents and options passed to the publish command
# Create a new post file # # Remove the old draft file #