useDuxtCollection()
Which collection serves this route.
Signature
const { collection, source, sources } = useDuxtCollection();
Returns
| Value | Type | What it is |
|---|---|---|
collection | string | The collection name serving the current route |
source | object | The resolved source behind it |
sources | array | Every resolved source |
Notes
collection is a string, not a literal type — a site collection names are
generated from its own sources, so nothing in the layer can name them. Pass it to
queryCollection rather than writing 'docs'.
Was this page helpful?