Using Jupyter Notebook with Pelican in Windows

Update: This solution does not work with nbconvert >= 6. Tested on nbconvert == 5.6.1.

Jupyter-Pelican is a plugin that helps Pelican to generate static contents from Jupyter notebook. I like it because it allows the user to put the metadata in the first cell of the notebook. No need to create a separate file for the metadata or edit the metadata of the notebook. However, this option will encounter a permission denied error on Windows OS because Windows does not allow (at least easily) openning a temporary file for a second time, according to the documentation of tempfile.NamedTemporaryFile more ...