我正在为Jekyll编写一个转换器插件,需要访问一些页眉(YAML前端)属性.只有内容传递给主转换器方法,似乎无法访问上下文.
例:
module Jekyll
class UpcaseConverter < Converter
safe true
priority :low
def matches(ext)
ext =~ /^\.upcase$/i
end
def output_ext(ext)
".html"
end
def convert(content)
###########
#
# Its here that I need access to the content page header data
#
#
###########
content.upcase
end
end
end
Run Code Online (Sandbox Code Playgroud)
有关如何在转换器插件中访问页眉数据的任何想法?