getpelican / pelican

Static site generator that supports Markdown and reST syntax. Powered by Python.
https://getpelican.com
GNU Affero General Public License v3.0
12.61k stars 1.81k forks source link

Optimize imports in `tasks.py.jinja2` #3387

Closed gagath closed 2 months ago

gagath commented 3 months ago

When opening the generated tasks.py file with a Python linter enabled, some imports will be marked as unecessary depending on the options passed to pelican-quickstart.

Add if statements around the optional imports so they are used only when necessary.

Pull Request Checklist