Merge branch 'master' into site

This commit is contained in:
Brandon Mathis 2011-07-28 11:00:17 -04:00
commit 84e4979d8b
2 changed files with 12 additions and 2 deletions

View File

@ -128,9 +128,13 @@ end
desc "Move sass to sass.old, install sass theme updates, replace sass/custom with sass.old/custom"
task :update_style, :theme do |t, args|
theme = args.theme || 'classic'
if File.directory?("sass.old")
puts "removed existing sass.old directory"
system "rm -r sass.old"
end
system "mv sass sass.old"
puts "## Moved styles into sass.old/"
system "mkdir -p sass; cp -R #{themes_dir}/"+theme+"/sass/* sass/"
system "mkdir -p sass; cp -R #{themes_dir}/"+theme+"/sass/ sass/"
cp_r "sass.old/custom/.", "sass/custom"
puts "## Updated Sass ##"
end
@ -138,9 +142,13 @@ end
desc "Move source to source.old, install source theme updates, replace source/_includes/navigation.html with source.old's navigation"
task :update_source, :theme do |t, args|
theme = args.theme || 'classic'
if File.directory?("#{source_dir}.old")
puts "removed existing #{source_dir}.old directory"
system "rm -r #{source_dir}.old"
end
system "mv #{source_dir} #{source_dir}.old"
puts "moved #{source_dir} into #{source_dir}.old/"
system "mkdir -p #{source_dir}; cp -R #{themes_dir}/"+theme+"/source/*. #{source_dir}"
system "mkdir -p #{source_dir}; cp -R #{themes_dir}/"+theme+"/source/. #{source_dir}"
system "cp -Rn #{source_dir}.old/. #{source_dir}"
system "cp -f #{source_dir}.old/_includes/navigation.html #{source_dir}/_includes/navigation.html"
puts "## Updated #{source_dir} ##"

View File

@ -75,6 +75,7 @@ module Jekyll
code = super.join
source = "<div><figure role=code>"
source += @caption if @caption
source = context['pygments_prefix'] + source if context['pygments_prefix']
if @filetype
@filetype = 'objc' if @filetype == 'm'
@filetype = 'perl' if @filetype == 'pl'
@ -82,6 +83,7 @@ module Jekyll
else
source += "<pre><code>" + code.lstrip.rstrip.gsub(/</,'&lt;') + "</code></pre></figure></div>"
end
source = source + context['pygments_suffix'] if context['pygments_suffix']
partial = Liquid::Template.parse(source)
context.stack do
partial.render(context)