meeb / django-distill

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

Make `distill_func` optional #43

Closed GergelyKalmar closed 3 years ago

GergelyKalmar commented 3 years ago

I find that I very often create a function that does nothing:

def return_none() -> None:
    return None

just so I can provide it to distill_func:

urlpatterns = [
    distill_path('', TemplateView.as_view(template_name='home.html'), name='home',
                 distill_func=return_none),
    # ... (the same repeating many times)
]

It seems that using a return_none-like function by default (and defaulting to it when it is not provided for distill_path) would be a more elegant approach in these cases.

meeb commented 3 years ago

This sounds fine. I've pushed this feature as a commit just now. It'll be bundled into the next release.

GergelyKalmar commented 3 years ago

Nice, thank you very much! Also thank you for the work on django-distill, it is a nice and simple library that does the job very well!

meeb commented 3 years ago

No problem and thanks for the kind words! As there's nothing else really in the pipeline I've pushed this feature up as the 2.8 release on PyPI.