danielfrg / pelican-jupyter

Pelican plugin for blogging with Jupyter/IPython Notebooks
Apache License 2.0
422 stars 105 forks source link

Images copy pasted as attachments not rendering in HTML #115

Open sudheer opened 4 years ago

sudheer commented 4 years ago

The images copy pasted into markdown cell in Jupiter notebooks are not able to render in html generated using pelican.

jooh commented 4 years ago

I found a reasonable workaround for this. If you have the standard 'images/' static path in your pelicanconf you can place the image there, then add a symlink to 'images' in the content directory where your notebook is located. Now the images will appear both in the jupyter notebook and in your website output because the relative path remains valid.

So for example, in shell:

cd content/data
ln -s ../../images

in your Jupyter notebook markdown cell:

![Poldrack et al., 2017](images/Poldrack_Scanning_2017.png)

and in your pelicanconf.py:

STATIC_PATHS = ["extra/CNAME", "extra/favicon.ico", "images", "extra/custom.css"]