Jekyll多个永久链接支持

Sag*_*tay 11 permalinks jekyll github-pages

Jekyll是否支持设置多个永久链接?

例如,我目前在我的内容中有以下内容_config.yml:

permalink: /:categories/:title/

我想拥有的是以下内容:

permalink: - /:categories/:title/ - /:year/:month/:day/:title/

我正在努力实现它,一个帖子将有多个URL.我很清楚我可以使用"redirect_from"插件(我在GitHub页面中托管),但这需要我手动更新我的所有帖子以包含redirect_from在YAML中

w1n*_*n78 2

你检查过 jekyll-archives 了吗?https://github.com/jekyll/jekyll-archives

您可以创建其他永久链接,例如

permalinks:
  year: '/:year/'
  month: '/:year/:month/'
  day: '/:year/:month/:day/'
  tag: '/tag/:name/'
  category: '/category/:name/'
Run Code Online (Sandbox Code Playgroud)

我认为你不能使用 :title 。这是一个列出帖子的索引页。