agentofuser
agentofuser

Reputation: 9307

How do I specify a custom URL path for a Jekyll collection?

What if I want it to write the collection documents to /m/some_subdir/some_doc.html, for instance, but keep the collection name as my_collection?

The documentation says:

If you’d like Jekyll to create a public-facing, rendered version of each document in your collection, set the output key to true in your collection metadata in your _config.yml:

collections:
  my_collection:
    output: true

This will produce a file for each document in the collection. For example, if you have _my_collection/some_subdir/some_doc.md, it will be rendered using Liquid and the Markdown converter of your choice and written out to /my_collection/some_subdir/some_doc.html.

But gives no option for configuring that.

Upvotes: 1

Views: 1802

Answers (1)

jupiteror
jupiteror

Reputation: 1205

You should add the following in your _config.yml file:

collections:
  my_collection:
    output: true
    permalink: /m/:path/

Simply permalink: "m" is not enough.

And you should update to Jekyll 2.1.0.

Upvotes: 2

Related Questions