Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add "apply_data" option.

Hiki markup (*) uses "{{...}}" syntax for plugin and Jekyll (Liquid) also
uses "{{...}}" syntax for variable expansion. When I use Hiki -> HTML
converter, the "{{...}}" syntax is conflicted. I can't resolve the conflict
in source file because Liquid doesn't have escape syntax. So this change
adds "apply_data" page data option that controls whtether Liquid is used or not.
When I add the following header, I can solves the conflict:
---
apply_data: false
---

(*) http://hikiwiki.org/en/TextFormattingRules.html#l19
  • Loading branch information...
commit 0f1dd614ebceb331185636bb1bf1d372ac61c6c3 1 parent 6a75688
@kou kou authored
Showing with 14 additions and 4 deletions.
  1. +14 −4 lib/jekyll/convertible.rb
View
18 lib/jekyll/convertible.rb
@@ -75,10 +75,12 @@ def do_layout(payload, layouts)
payload["pygments_prefix"] = converter.pygments_prefix
payload["pygments_suffix"] = converter.pygments_suffix
- begin
- self.content = Liquid::Template.parse(self.content).render(payload, info)
- rescue => e
- puts "Liquid Exception: #{e.message} in #{self.data["layout"]}"
+ if apply_data?
+ begin
+ self.content = Liquid::Template.parse(self.content).render(payload, info)
+ rescue => e
+ puts "Liquid Exception: #{e.message} in #{self.data["layout"]}"
+ end
end
self.transform
@@ -108,5 +110,13 @@ def do_layout(payload, layouts)
end
end
end
+
+ # Whether apply template data or not.
+ #
+ # Returns true if "apply_data" data isn't "no" nor
+ # "false", false otherwise.
+ def apply_data?
+ not ["no", "false"].include?(self.data["apply_data"].to_s.downcase)
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.