2
votes

I want to add collections to my Jekyll site. In my _config.yml file I set output: true:

collections:
  faq:
    output: true    

In my source folder I added _faq folder and created a file named 1.md in it.

When I generate the site I can see my document at http://localhost:4000/faq/1.html. But when I customize the permalink for this document and add permalink: /faq/1 in its YAML front-matter, it doesn't display at http://localhost:4000/faq/1 and downloads to the computer instead.

Is there any way to customize permalinks for documents in Jekyll collections (to show without .html extension)?

2

2 Answers

3
votes

The permalink should be permalink: /faq/1/, then it works.

1
votes

Permalink should be permalink: /faq/:path/

That will set the correct relative path for all files and subfolders of that collection and drop the .html suffix.