Giving a collection a longer name?


#1

I’m new to Jekyll, so I apologize if this is hiding somewhere. I searched and couldn’t find it.

I’m trying to create a collection of documents, possibly more than one collection. Basically, each collection will be a book, divided into chapters. So when I recurse through with a collection archive page, I want it to show the book title, with the chapters or sections underneath.

Problem is, I can’t figure out how to give a collection a long name. I put together the words with underscores, but it gets unwieldy very quickly with the directory that’s needed to store the chapters. If I give it a short name (an acronym for all the first letters in the title), it’s usable, but then on the archive page no one can understand which book is which.

I also tried just creating one large collection called “books” and putting the book titles into the header of the markdown in the individual files, but then I get an archive search result for every chapter listed and they’re not organized (even if I use subdirectories).

So, is there any sort of configuration option I can use to specify a “real name” to appear as opposed to the short name?

Any help is appreciated.


#2

there might be some trickery you could do with a data file - use the shortname in the collection, then reference a data file that has key: value pairs? people do this for categories with multiple words in a similar way.

maybe also collection defaults, though that is just a wild guess, no idea if that would work - example from the docs:

collections:
  my_collection:
    foo: bar

maybe foo could be the long name? I think I would try this before the data file as this seems easier to maintain.


#3

Thanks. I’ll try the collection default method and see what happens.


#4

FYI. It worked! Thank you.