Device info:
- MacBook Pro (15-inch, 2017)
- 2.8 GHz Quad-Core Intel Core i7
- MacOS Monterey 12.4
Given the following directory structure:
# ...various NextJS files and dirs...
|— vault
| |— posts
| | |— some-post.md
| |— books
| | |— some-book.md
| |— templates
| | |— some-template.md
| |— some-unpublished-file.md
|— contentlayer.config.ts
And given the following Content Layer source configuration:
export default makeSource({
contentDirPath: 'vault',
contentDirInclude: [
'books',
'posts',
],
documentTypes: [
Post,
Book,
],
})
I would expect to load in both ./vault/posts/some-post.md and ./vault/books/some-book.md, but no documents are loaded.
If I remove the contentDirInclude statement, my desired documents are loaded, however both some-template.md and some-unpublished-file.md will be checked and give me a warning about undefined documents.
If I switch to use contentDirExclude with the following configuration:
export default makeSource({
contentDirPath: 'vault',
contentDirExclude: [
'.',
'templates',
],
documentTypes: [
Post,
Book,
],
})
I successfully load my desired documents and ignore some-template.md, however some-unpublished-thought.md still gets checked.
Is there some error in how I am referring to directories in using these options? I've tried variations such as ./ instead of ., or ./books/ and vault/books instead of books.
Device info:
Given the following directory structure:
And given the following Content Layer source configuration:
I would expect to load in both
./vault/posts/some-post.mdand./vault/books/some-book.md, but no documents are loaded.If I remove the
contentDirIncludestatement, my desired documents are loaded, however bothsome-template.mdandsome-unpublished-file.mdwill be checked and give me a warning about undefined documents.If I switch to use
contentDirExcludewith the following configuration:I successfully load my desired documents and ignore
some-template.md, howeversome-unpublished-thought.mdstill gets checked.Is there some error in how I am referring to directories in using these options? I've tried variations such as
./instead of., or./books/andvault/booksinstead ofbooks.