outstatic icon indicating copy to clipboard operation
outstatic copied to clipboard

No such file or directory — `.gitkeep.md`

Open mamunonweb opened this issue 2 years ago • 3 comments

Currently, the existence of files other than mdx? (ex: .gitkeep) within a collection folder results in an error:

Error: ENOENT: no such file or directory, open "blog/outstatic/content/posts/.gitkeep.md"

mamunonweb avatar Oct 25 '22 13:10 mamunonweb

Same issue here. Deleting .gitkeep from the folder fixed for me. But if you do that make sure to add at least one .md file into the directory to ensure it is properly uploaded to git.

Currently, the existence of files other than mdx? (ex: .gitkeep) within a collection folder results in an error:

Error: ENOENT: no such file or directory, open "blog/outstatic/content/posts/.gitkeep.md"

clemmurphy avatar Oct 25 '22 13:10 clemmurphy

@avitorio @clemmurphy

I think as slugs we should only consider mdx? files name (without extension).

// now
getDocumentSlugs('posts') // ['post-1.md', 'post-2.mdx', 'images', '.gitkeep']

// then
getDocumentSlugs('posts') // ['post-1', 'post-2']

mamunonweb avatar Oct 25 '22 14:10 mamunonweb

Hey @mamunonweb, I wasn't aware this was happening. I'll take a look at it and try to create a fix sometime this week. Feel free to try to fix it yourself and create a PR if possible.

By the way, we need that .gitkeep to create the collection folder, otherwise git will just ignore it.

avitorio avatar Oct 25 '22 14:10 avitorio