Not a directory @ dir_s_mkdir

Hello everyone!
I created a Jekyll blog few months ago and it worked perfectly. I haven’t posted anything for a month or two and now I wanted to add new post but it keeps reporting an error, as you can see:

I don’t know how could I fix the “mkdir” problem, thank you for any advise!
(I’m not an IT specialist, please be tolerant :slight_smile: )

Delete your _site directory
Then build again.

Make sure all your pages end with .md or .html.

Can you share a link to your repo on GitHub?

Check if you have any saved changes that are not committed.

git status

If so, then stash them

git stash -u

And then build again. Hopefully you had a clean working state before to revert to.

Reverse the stash step when you are done.

git stash pop

You can also look at your repo on GitHub if you have it setup with GH Pages. and see the last successful commit in history that built.

Thank you for your answer!
When I built _site directory again, it doesn’t create folders with posts (2020,2021).
I checked the git status but it says “Changes not staged for commit” and then lists actually all files I have ever changed or deleted.
This is link to my GitHub repo GitHub - mattiikk/stranka: Zkouška mepi stránky but I don’t use GitHub Pages.

Thanks. Yes I see our _site directory in github which is a bad idea. It is mean to unversioned and then generated on each build.

Delete it locally.

Then commit the delete.

git add _site
git commit

Then add it your ignore file. I have one suitable for Jekyll 4 here. Leave out the .env bit.

Add the ignore file and commit that.

Then you can build without causing issues with _site. As it will be deleted and recreated each time and won’t show up as changed files.

Then see if your issue persists on build.