meeb / django-distill

Minimal configuration static site generator for Django
MIT License
441 stars 35 forks source link

Is it possible to exclude static dirs #91

Closed 0xarnout closed 5 months ago

0xarnout commented 5 months ago

Hello there, thanks for maintaining this great project! But I wonder if it's possible to exclude static files of other Django packages because most of them aren't needed on a static website. For now I just delete them, but I would be very happy if I could properly configure this.

meeb commented 5 months ago

Hi, thanks! It's currently not, setting DISTILL_SKIP_ADMIN_DIRS to True will make distill ignore admin and grapelli static directories, but this isn't customisable at the moment. Would some DISTILL_SKIP_DIRS = ['other_dir', 'another_dir'] setting do what you want?

0xarnout commented 5 months ago

Yes, exactly! That would be the perfect solution. I would be happy if an option like that can be added.

meeb commented 5 months ago

The above commit and related updated tests should add this feature as:

DISTILL_SKIP_STATICFILES_DIRS = ['dir1', 'dir1']

in your settings.py. This will skip static/dir and static/dir2 respectively in this example.

edit: I'll bundle this into the next release.