Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

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

Open
flothesof opened this issue Apr 23, 2020 · 2 comments
Open

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

flothesof opened this issue Apr 23, 2020 · 2 comments

Comments

@flothesof
Copy link

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:

  • do you see a workaround for my situation that I have missed?
  • would it make sense to implement a caching mechanism to prevent the notebook output to be generated even when there were no changes?

Thank you for your help.
Florian

@danielfrg
Copy link
Owner

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
Copy link
Author

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants