Skip to content

Commit 20de112

Browse files
committed
include_code is now more forgiving, stripping leading forward slashes from the code_dir config
1 parent df86e64 commit 20de112

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

plugins/include_code.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def initialize(tag_name, markup, tokens)
3838
end
3939

4040
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')
4242
code_path = (Pathname.new(context.registers[:site].source) + code_dir).expand_path
4343
file = code_path + @file
4444

0 commit comments

Comments
 (0)