Browse code

include_code is now more forgiving, stripping leading forward slashes from the code_dir config

Brandon Mathis authored on 29/07/2011 at 14:49:37
Showing 1 changed files
... ...
@@ -38,7 +38,7 @@ module Jekyll
38 38
     end
39 39
 
40 40
     def render(context)
41
-      code_dir = (context.registers[:site].config['code_dir'] || 'downloads/code')
41
+      code_dir = (context.registers[:site].config['code_dir'].sub(/^\//,'') || 'downloads/code')
42 42
       code_path = (Pathname.new(context.registers[:site].source) + code_dir).expand_path
43 43
       file = code_path + @file
44 44