Collections are rendered for every modification


I have a multilingual site where every translated page belongs to a collection (_en, _es, _ja…) I use the option output: true to generate HTML from collections’ documents. Every collection has far now 140 documents.

Also I have a shared image folder. Every time I run jekyll in watch mode and modify an image ALL the collections are rendered, which takes nearly over a minute, even when their content has not changed.

I suspect this is the expected behavior, maybe I’m wrongly using collections instead of static pages. I wonder if there is a way to prevent Jekyll from render collections’ documents when I modify other parts in the project.


any time any file gets modified/added the entire site folder contents are deleted and re-rendered so that is normal behavior.

You can separate your assets like images,css and js from jekyl by using Gulp which will make that part a lot better.

recent post about this here:

Thanks for your reply.

Unfortunately assets are not my build problem, but the nearly 420 document pages I have to render every time I change one line in an unrelated file.

I was thinking about your the inverse way you did: moving to Hugo, since I heard that is lightning fast.

separating out the assets makes everything faster - I may not have been clear there - it isn’t just changing images that is faster, the whole site will compile faster since jekyll won’t have to do anything with the assets. If you only have a handful of images and no sass then it probably would not help you any, but if you have 100’s of images and lots of sass, offloading that will help.

Hugo is faster at page generation for sure though.

Yes, I understood what you mean: to having a separate process watching changes over assets. My images uses a Jekyll plugin to transform .tex files into .pdf and then into .svg. I could extract that logic into a separate script. In fact, I could end having a Makefile for all the documents/images and bypass completely the Jekyll build system.

But my question was if, only using the Jekyll build system, is there a flag, technique, configuration… to prevent collection documents from being rendered every time a change is detected in any file in the project.

there is a command for incremental builds which is what you want, but I don’t think I have heard anyone have much success with it but you could try it.

I think it is just jekyll serve --incremental - I think it may have issues with which pages need to be rebuilt cause there could be for loops doing stuff all over the place. It may work when doing dev work and you just want to see one page though. I have not used it, I think it is not considered production ready - much more of an experiment as I understand it.

Based on what you are saying about the plugin transforming your images I would guess that is most of your pain. There is also a command that tells you where all the time is going jekyll build --profile that may be able to tell you that the actual document creation is not your problem - or that it is.

I already use the --incremental flag which is useful to build only those images I modify, but it doesn’t prevent Jekyll from parse/render/write the entire collections.

I didn’t know about the --profile though. I’ll take a look, thanks!