added yml alias for yaml code highlighting

This commit is contained in:
Brandon Mathis 2011-08-01 17:35:33 -04:00
parent 08dc63a95e
commit 7b52fb492e
2 changed files with 2 additions and 0 deletions

View File

@ -79,6 +79,7 @@ module Jekyll
if @filetype
@filetype = 'objc' if @filetype == 'm'
@filetype = 'perl' if @filetype == 'pl'
@filetype = 'yaml' if @filetype == 'yml'
source += " #{highlight(code, @filetype)}</figure></div>"
else
source += "<pre><code>" + code.lstrip.rstrip.gsub(/</,'&lt;') + "</code></pre></figure></div>"

View File

@ -55,6 +55,7 @@ module Jekyll
@filetype = file.extname.sub('.','')
@filetype = 'objc' if @filetype == 'm'
@filetype = 'perl' if @filetype == 'pl'
@filetype = 'yaml' if @filetype == 'yml'
title = @title ? "#{@title} (#{file.basename})" : file.basename
url = "#{context.registers[:site].config['url']}/#{code_dir}/#{@file}"
source = "<div><figure role=code><figcaption><span>#{title}</span> <a href='#{url}'>download</a></figcaption>\n"