From 913fa105c4a6793e6522ca45b85d8f06c803c6b9 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Sat, 11 Jun 2011 15:58:53 -0400 Subject: 1. Moved _plugins into themes/classic/_plugins I think it's probably better to ship plugins with themes to make it easier to update them. 2. Improved 'install' rake task and made nicer output --- _plugins/pygments_cache_patch.rb | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 _plugins/pygments_cache_patch.rb (limited to '_plugins/pygments_cache_patch.rb') diff --git a/_plugins/pygments_cache_patch.rb b/_plugins/pygments_cache_patch.rb deleted file mode 100644 index 36c78d20..00000000 --- a/_plugins/pygments_cache_patch.rb +++ /dev/null @@ -1,30 +0,0 @@ -# -# Author: Raimonds Simanovskis, http://blog.rayapps.com/ -# Source URL: https://github.com/rsim/blog.rayapps.com/blob/master/_plugins/pygments_cache_patch.rb -# - -require 'fileutils' -require 'digest/md5' - -PYGMENTS_CACHE_DIR = File.expand_path('../../_cache', __FILE__) -FileUtils.mkdir_p(PYGMENTS_CACHE_DIR) - -Jekyll::HighlightBlock.class_eval do - def render_pygments(context, code) - if defined?(PYGMENTS_CACHE_DIR) - path = File.join(PYGMENTS_CACHE_DIR, "#{@lang}-#{Digest::MD5.hexdigest(code)}.html") - if File.exist?(path) - highlighted_code = File.read(path) - else - highlighted_code = Albino.new(code, @lang).to_s(@options) - File.open(path, 'w') {|f| f.print(highlighted_code) } - end - else - highlighted_code = Albino.new(code, @lang).to_s(@options) - end - output = add_code_tags(highlighted_code, @lang) - output = context["pygments_prefix"] + output if context["pygments_prefix"] - output = output + context["pygments_suffix"] if context["pygments_suffix"] - output - end -end -- cgit v1.2.1