SaguiItay
SaguiItay

Reputation: 2215

Jekyll multiple Permalinks support

Does Jekyll support setting multiple permalinks?

For example, I currently have the following in my _config.yml:

permalink: /:categories/:title/

What I would like to have, is the following:

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

What I'm trying to achieve it that a single post will have multiple URLs. I'm well aware that I can use the "redirect_from" plugin (I'm hosting in GitHub Pages), but that would require me to manually update all my posts to include the redirect_from in the YAML

Upvotes: 16

Views: 2485

Answers (1)

w1n78
w1n78

Reputation: 789

have you checked out jekyll-archives? https://github.com/jekyll/jekyll-archives

you can create other permalinks like

permalinks:
  year: '/:year/'
  month: '/:year/:month/'
  day: '/:year/:month/:day/'
  tag: '/tag/:name/'
  category: '/category/:name/'

i don't think you can use :title though. it's an index page that lists posts.

Upvotes: 2

Related Questions