Generated list of another document type as a field? #524
Unanswered
iamnbutler
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to determine the viability of nesting documents with the current functionality within ContentLayer.
I have
ContentType: Foo
incontent/foo/**
, andContentType: Bar
incontent/bar/**
.I'd like to have something like:
But I specifically don't want to have to handwrite a list of all the
bar
's that exist; I want that to be generated from thecontent/bar/[id_of_foo]/**
directory.I'm aware of the
reference
type:But this outputs a list of strings, not a list of objects.
I can do things post-Contentlayer generation, but ideally, I'd rather have Contentlayer do the whole thing.
Is this currently possible, either via a native field type or by some calculated field type shenanigans? Apologies if this has been asked already; I searched through the discussions and the issues and didn't see anything obvious.
Beta Was this translation helpful? Give feedback.
All reactions