Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add "apply_data" option. #349

Closed
wants to merge 1 commit into from

4 participants

@kou

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

@kou kou 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
0f1dd61
@pepijndevos

It seems to me that an option for modifying the liquid characters, like you can in Mustache, is a much better idea. And, if you remove the front matter completely, doesn't that have the same result as you are describing?

@kou

Umm... I don't think changing syntax isn't better idea... It is confused to me.

And, if you remove the front matter completely, doesn't that have the same result as you are describing?

I'm sorry but I can't imagine a problem case. Could you show me a problem case?

@tombell

No one replied in a year, might be worth closing this PR.

@parkr
Owner

I know this was a well-intentioned PR, but just... wat.

<3

@parkr parkr closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 20, 2011
  1. @kou

    add "apply_data" option.

    kou authored
    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
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.