... | ... |
@@ -26,9 +26,14 @@ require 'pathname' |
26 | 26 |
module Jekyll |
27 | 27 |
|
28 | 28 |
class RenderPartialTag < Liquid::Tag |
29 |
- def initialize(tag_name, file, tokens) |
|
29 |
+ def initialize(tag_name, markup, tokens) |
|
30 |
+ @file = nil |
|
31 |
+ @raw = false |
|
32 |
+ if markup =~ /^(\S+)\s?(\w+)?/ |
|
33 |
+ @file = $1.strip |
|
34 |
+ @raw = $2 == 'raw' |
|
35 |
+ end |
|
30 | 36 |
super |
31 |
- @file = file.strip |
|
32 | 37 |
end |
33 | 38 |
|
34 | 39 |
def render(context) |
... | ... |
@@ -45,9 +50,13 @@ module Jekyll |
45 | 45 |
if contents =~ /\A-{3}.+[^\A]-{3}\n(.+)/m |
46 | 46 |
contents = $1.lstrip |
47 | 47 |
end |
48 |
- partial = Liquid::Template.parse(contents) |
|
49 |
- context.stack do |
|
50 |
- partial.render(context) |
|
48 |
+ if @raw |
|
49 |
+ contents |
|
50 |
+ else |
|
51 |
+ partial = Liquid::Template.parse(contents) |
|
52 |
+ context.stack do |
|
53 |
+ partial.render(context) |
|
54 |
+ end |
|
51 | 55 |
end |
52 | 56 |
end |
53 | 57 |
end |