mirror of
https://github.com/moparisthebest/android.moparisthebest.org
synced 2025-01-12 14:18:03 -05:00
added yml alias for yaml code highlighting
This commit is contained in:
parent
40b444c9cd
commit
8e978596b6
@ -79,6 +79,7 @@ module Jekyll
|
|||||||
if @filetype
|
if @filetype
|
||||||
@filetype = 'objc' if @filetype == 'm'
|
@filetype = 'objc' if @filetype == 'm'
|
||||||
@filetype = 'perl' if @filetype == 'pl'
|
@filetype = 'perl' if @filetype == 'pl'
|
||||||
|
@filetype = 'yaml' if @filetype == 'yml'
|
||||||
source += " #{highlight(code, @filetype)}</figure></div>"
|
source += " #{highlight(code, @filetype)}</figure></div>"
|
||||||
else
|
else
|
||||||
source += "<pre><code>" + code.lstrip.rstrip.gsub(/</,'<') + "</code></pre></figure></div>"
|
source += "<pre><code>" + code.lstrip.rstrip.gsub(/</,'<') + "</code></pre></figure></div>"
|
||||||
|
@ -55,6 +55,7 @@ module Jekyll
|
|||||||
@filetype = file.extname.sub('.','')
|
@filetype = file.extname.sub('.','')
|
||||||
@filetype = 'objc' if @filetype == 'm'
|
@filetype = 'objc' if @filetype == 'm'
|
||||||
@filetype = 'perl' if @filetype == 'pl'
|
@filetype = 'perl' if @filetype == 'pl'
|
||||||
|
@filetype = 'yaml' if @filetype == 'yml'
|
||||||
title = @title ? "#{@title} (#{file.basename})" : file.basename
|
title = @title ? "#{@title} (#{file.basename})" : file.basename
|
||||||
url = "#{context.registers[:site].config['url']}/#{code_dir}/#{@file}"
|
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"
|
source = "<div><figure role=code><figcaption><span>#{title}</span> <a href='#{url}'>download</a></figcaption>\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user