Hi Forum, what I what to achieve is this. Say I have two types of categories, journals
and essays
.
I want essays
to have the following permalink structure:
permalink: essay/:title
And journals
to have the following permalink structure:
permalink: journal/:year/:month/:day/:title
Now, the reason behind this is because I want essays
to have a shorter link so that they can be easily accessible through link like http://www.example.com/essays/title and journals
to have a link structure that emphasizes on when they where created: http://www.example.com/journals/2017/03/07/title.
I would like to configure this in the _config.yml
file, as apposed to writing the permalink setting in each of the post front-matter
My solution - Collections
Currently, I am able to solve the permalink problem with collections since you can explicitly define the permalink structure for each collection. What I did is create two new collections: journals
and essays
.
collections:
essays:
permalink: essay/:title
journals:
permalink: journal/:year/:month/:day/:title
However, the problem with collections that I have, is that they are mainly meant for non-post based content. Although they work as text-based content, I found some limitations. For example, site.related_posts
only accounts for posts
only. Many Jekyll plugins, jekyll-feed
for example, relies mostly on posts
and not collections to generate RSS feeds. So basically, I’m using collections for text-based stuff, which imposes some limits on the flexibility.
If there is a way to treat collections as posts, then that would probably solve my problem. But otherwise, I think the best way to go about this, is to define the permalink for each post category.