How to Efficiently Manage Collections with Custom Permalinks in Jekyll?

Hey guys… :wave:

I am working on a Jekyll site that uses several collections (e.g., blog posts, case studies, and tutorials), and I want to assign each collection a unique permalink structure. For example:

  • Blog posts should follow: /blog/:year/:month/:title/
  • Case studies should follow: /case-studies/:title/
  • Tutorials should follow: /tutorials/:category/:title/

I have managed to get the basic permalink structures set up in _config.yml, but I’m running into a few issues:

  1. Some pages in the collections do not seem to respect the specified structure. They either end up with the default permalink or break entirely.
  2. Is there a way to automatically generate these without manually adding front matter to every file?
  3. How do these custom permalinks interact with pagination, particularly for the blog collection?

I also check this: https://talk.jekyllrb.com/t/automotive-makes-and-models-a-case-of-nested-collections-and-permalinksalesforce-admin But I have not found any solution. Could anyone guide me about this? If anyone has experience managing this kind of setup or can point me toward any plugins or best practice.

Thanks in advance!

Respected community member!

I’d investigate this more to see what is happening. Maybe some pages have a permalink in the frontmatter?

Category and tag are specific to posts - so using them in a permalink might work, but in a normal non post collection they will just be ordinary front matter variables that I don’t think will be available in the permalink.

So if your blog is really a post that permalink should be ok, the second one should be ok as a collection but the 3rd one probably is not possible to have setup to automatically work.

I don’t use permalinks much so don’t take this as the absolute truth, more like a rough guess.