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'      => path_slug(@options['path']),
        'extension' => File.extname(@options['path']).sub(/^\./, ''),
        'content'   => read_post_content,
        'dir'       => @options['dir'],
        'type'      => "post from draft",
        'write_message' => "Published: #{relative_path(path)} →",
        'force'     => @options['force']
      }

      # Create a new post file
      #
      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'      => path_slug(@options['path']),
        'extension' => File.extname(@options['path']).sub(/^\./, ''),
        'content'   => read_post_content,
        'dir'       => @options['dir'],
        'type'      => "post from draft",
        'write_message' => "Published: #{relative_path(path)} →",
        'force'     => @options['force']
      }

      # Create a new post file
      #
      Post.new(site, post_options).write
      
      # Remove the old draft file
      #
      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