0
votes

I'm trying to customize the permalinks for the pages in my collection. The directory looks like this:

writing
 |
 --file.md
 --file2.md
 --some-dir/
    |
    --another.md
    --something.md

I want the URLs to be

  • /writing/[file-title]/index.html
  • /writing/[file2-title]/index.html
  • /writing/some-dir/[another-title]/index.html
  • /writing/some-dir/[something-title]/index.html

I tried setting my collections permalink to

permalink: /:collection/:path/:title

but :path contains the full path (including the filename), instead of just the path to the file's directory.

Is there any way to accomplish this?

1

1 Answers

0
votes

The nearest thing you can get will be with permalink: /:collection/:path/. Your file name just has to be the slugified title. title: My title -> my-title.md