fastai / fastpages

An easy to use blogging platform, with enhanced support for Jupyter Notebooks.
https://fastpages.fast.ai/
Apache License 2.0
3.53k stars 756 forks source link

Create _posts dir during build if it isn't present. #541

Closed alexlenail closed 3 years ago

alexlenail commented 3 years ago

I merged a feature branch into master with some updates to a notebook, and my posts disappeared. Looking through the build, for every notebook I see:

converting: _notebooks/notebook.ipynb
[Errno 2] No such file or directory: '_posts/2021-05-23-notebook.md'
...
Conversion failed on the following:
notebook.ipynb
...

In this merge commit, I deleted the posts in _posts/notebook.md because I thought the github actions would create those files anyways. Am I thinking about fastpages incorrectly? Or is it just that I need to have a non-empty _posts/ folder for the CI job to work...?

github-actions[bot] commented 3 years ago

Thank you for opening an issue. If this issue is related to a bug, please follow the steps and provide the information outlined in the Troubleshooting Guide. Failure to follow these instructions may result in automatic closing of this issue.

alexlenail commented 3 years ago

re-creating _posts/ solved the issue. Should that be added to the build step?

hamelsmu commented 3 years ago

Not sure why you don't have _posts/ that folder is in this repo. I think you may have deleted it?

hamelsmu commented 3 years ago

Also yes, _posts is a required directory. I think this error is a good thing. I'll add something to that directory's README to warn users not to delete it.