danielfrg / pelican-jupyter

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

not rendering notebooks every time (when there was no change)? #116

Open flothesof opened 4 years ago

flothesof commented 4 years ago

Hi, I've been using your plugin for quite some time for my blog (source: https://github.com/flothesof/PelicanBlog) which basically consists of .md posts that look like this:

Title: A Phased Array Animation
lang: en
date: 2020-04-22 17:10
comments: true
slug: phased-array-animation
Tags: Waves, Physics, Animations
Category: Python
Image: /images/thumbnail_20200422_PhasedArrayAnimation.png
Summary: Inspired by a recent Twitter post, I recreate a phased array animation using numpy, matplotlib and holoviews.

{% notebook posts/20200422_PhasedArrayAnimation.ipynb cells[:] %}

What I've noticed is that every time I run pelican to build the blog, even when there are no changes to the notebooks themselves, all the notebooks get rebuilt. Since I have around 100 blog posts with notebooks now, this takes around 2 minutes every time I want to regenerate the site.

This is by no means a blocker but it is annoying when I'm trying to adjust the theme and tweak little things.

Therefore, I have two questions:

Thank you for your help. Florian

danielfrg commented 4 years ago

Yes, I totally get it. I have the same issue and I have learned to live with it tbh :D Its should be possible to implement some kind of caching and I will be happy to accept any PRs. Honestly its probably not much work to do this on the code for the plugin. What so is that I have all the notebooks in one directory and remove them when I need to iterate (not very often).

flothesof commented 4 years ago

Thanks for your feedback. Apparently, there is some sort of caching mechanism built-in with Pelican (see https://docs.getpelican.com/en/latest/settings.html#reading-only-modified-content), but I've been unable to make it work on my blog configuration. Do you have any pointers to how I could start investigating a modification of the plugin? Your tip about removing the notebook seems quite useful, thanks!