def parse_template(input)

      if @config['titlecase']
        @options['title'].titlecase!
      end

      vars = @options.dup

      # Allow templates to use slug
      #
      vars['slug'] = title_slug

      # Allow templates to use date fragments
      #
      date = Time.parse(vars['date'] || Time.now.iso8601)
      vars['date'] = date.iso8601
      vars['year'] = date.year
      vars['month'] = date.strftime('%m')
      vars['day'] = date.strftime('%d')
      vars['ymd'] = date.strftime('%Y-%m-%d')

      # If possible only parse the YAML front matter.
      # If YAML front-matter dashes aren't present parse the whole 
      # template and add dashes.
      #

      parsed = if input =~ /\A-{3}\s+(.+?)\s+-{3}(.+)?/m
        input = $1
        content = $2
        input << default_front_matter(input)
      else
        content = ''
      end

      template = Liquid::Template.parse(input)
      "---\n#{template.render(vars).strip}\n---\n#{content}"
    end
def parse_template(input)

      if @config['titlecase']
        @options['title'].titlecase!
      end

      vars = @options.dup

      # Allow templates to use slug
      #
      vars['slug'] = title_slug

      # Allow templates to use date fragments
      #
      date = Time.parse(vars['date'] || Time.now.iso8601)
      vars['date'] = date.iso8601
      vars['year'] = date.year
      vars['month'] = date.strftime('%m')
      vars['day'] = date.strftime('%d')
      vars['ymd'] = date.strftime('%Y-%m-%d')

      # If possible only parse the YAML front matter.
      # If YAML front-matter dashes aren't present parse the whole 
      # template and add dashes.
      #

      parsed = if input =~ /\A-{3}\s+(.+?)\s+-{3}(.+)?/m
        input = $1
        content = $2
        input << default_front_matter(input)
      else
        content = ''
      end

      template = Liquid::Template.parse(input)
      "---\n#{template.render(vars).strip}\n---\n#{content}"
    end
Render Liquid vars in YAML front-matter.