#How to get all collection names?

1 messages · Page 1 of 1 (latest)

wintry cedar
#

Say I have a website with 3 different content collections: Docs, Blogs and Themes. I would like to dynamically list these in my navigation menu. Can I use the content collections API to grab all 3 collections? I didn't see any function that could do this but perhaps I am missing something.

terse jungle
#

Hi, since we export collections in the config file, you could grab collection names like this:

import { collections } from 'src/content/config';

const collectionNames = Object.keys(collections);