Struggles with `contentDirInclude`
See original GitHub issueDevice 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
.
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top GitHub Comments
Sure thing @seancdavis! Apologies I kept working on this repo so I’ve gotta link to some commits to show where I was making this decision:
private
andpublic
directory to avoid the issue.npm run dev
though).Let me know if you need anything else to explore.
As background, I’m publishing updates to this repo to https://obsidian-nextjs-blog.netlify.app/. I think Content Layer will let me finally have my personal Obsidian knowledge graph notes right next to my personal site’s code so that I can take notes in Obsidian and publish them to a website simply by moving notes to designated folders in my Obsidian vault, while having the published and unpublished parts of my personal notes remain connected within Obsidian! Thanks for building this tool, it was the missing piece.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.