在Jekyll中获得这种“定制”永久链接方案的步骤是什么?

我正在写一个Jekyll设置,我想让我的post在表格中有一个永久链接: /2013/jan/something-something-in-january 。 我知道香草永久链接不可能:

  • 得到:month是以文本forms
  • 获取:title为划线分隔

我记得在某个地方读过我可以通过编写插件来实现这一点,但我不确定如何。 我怎样才能做到这一点?

我创建了一个生成器插件:

 module Jekyll class PermalinkRewriter < Generator safe true priority :low def generate(site) # Until Jekyll allows me to use :slug, I have to resort to this site.posts.each do |item| item.data['permalink'] = '/' + item.slug + '/' end end end end