Use Jupyter notebooks to publish with Hugo.
pip install hugo_jupyter
From your hugo project’s root
hugo_jupyter --init