我正在尝试一个简单的 Jekyll 插件:
class MonthlyArchives < Liquid::Tag
def initialize(tag_name, text, tokens)
super
@text = text
end
def render(context)
"#{@text} #{Time.now}"
end
end
Liquid::Template.register_tag('monthly_archives1', Jekyll::MonthlyArchives)
当我尝试在页面中运行它时,如下所示:
{% monthly_archives1 %}
我收到 Liquid 错误:参数数量错误(2 代表 0)。有任何想法吗 ?