From c2b750448e4389d5e766b77ce43f7e89ad0a9bee Mon Sep 17 00:00:00 2001 From: Aidan Feldman Date: Thu, 19 Dec 2013 17:14:51 -0500 Subject: [PATCH] allow data attribute access by Liquid on Convertible items --- lib/jekyll/convertible.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/jekyll/convertible.rb b/lib/jekyll/convertible.rb index 815c36b0..cdbe48c3 100644 --- a/lib/jekyll/convertible.rb +++ b/lib/jekyll/convertible.rb @@ -170,5 +170,14 @@ module Jekyll f.write(self.output) end end + + # Accessor for data properties by Liquid. + # + # property - The String name of the property to retrieve. + # + # Returns the String value or nil if the property isn't included. + def [](property) + data[property] + end end end