【发布时间】:2013-06-23 22:16:50
【问题描述】:
我正在开发一个插件来促进多语言 Jekyll 网站,作为其中的一部分,我必须根据他们的语言对帖子进行分类。
我正在尝试根据帖子的语言标记帖子,所以我覆盖了aggregate_post_info 方法,但是当我打印site.tags 变量时,它是空的。
module Jekyll
class Site
alias_method :_aggregate_post_info, :aggregate_post_info
def aggregate_post_info(post)
_aggregate_post_info(post)
@tags[post.data['lang']] << post
end
end
end
【问题讨论】: