RobertoCuba
RobertoCuba

Reputation: 901

Collection Permalinks using document Front Matter title

I have a bunch of documents in a collection that when developing, are more easily identified by their 'title code' which is why it would be best to use it as their filename (it helps keep a structure and order). Something like this:

_stories
    CH1S1.md
    CH1S2.md
    CH2S1.md

However, for the pretty urls, a slug from the document's title is better. From the docs it seems that just using the :title permalink parameter is exactly what I want, but the output always uses the document's filename (as if it was using :name instead of :title).

Here is my collection definition in _config.yml:

collections:
    stories:
        output: true
        permalink: /:collection/:title/

Of course, in each individual document's Front Matter I am setting the title property, so I am not sure why this is not working.

I am on the latest version of Jekyll.

Upvotes: 2

Views: 252

Answers (1)

jupiteror
jupiteror

Reputation: 1205

Try to set the permalink, instead of title, in YAML Front Matter of each file like this:

permalink: /stories/mystory/

Upvotes: 0

Related Questions