meeb/django-distill

Is it possible that django-distill doesn't touch something which is not changed?

Closed this issue · 4 comments

pretty much it, can we just generate the pages which are changed and not touch anything which has been generated before?

meeb commented

This is more up to you really, you can selectively iterate the URLs to iterate in your distill_func however you like. For example, don't yield the URL if the output file already exists on disk. Alternatively you can writing single files calls:

https://github.com/meeb/django-distill?tab=readme-ov-file#writing-single-files

and handle generating your static pages manually one at a time yourself. There's no sensible way for django-distill itself to "detect" what generated HTML has changed other than to generate everything and check if they're different on disk which would defeat the point. Your application would know the logic of what has changed and what needs regeneration.

Can I use database to generate pages?

meeb commented

I'm not entirely sure what you mean. Pretty much every Django project uses a database. If you mean database events, then yes check the link I pasted above which shows an example of how to use signals to generate single static pages on model save.

Thanks for help. I got what you are talking about.