Curious about this, but as I create the demo with a bunch of examples, a thought occurred to me: should a nav's template be allowed to be set on the nav itself?
Example:
from django_simple_nav.nav import Nav
from django_simple_nav.nav import NavItem
class ExampleListNav(Nav):
items = [
NavItem(title="Tailwind CSS", url="/tailwind/"),
]
template = """\
<ul>
{% for item in items %}
<li>
<a href="{{ item.url }}"
class="{% if item.active %}text-indigo-500 hover:text-indigo-300{% else %}hover:text-gray-400{% endif %}">
{{ item.title }}
</a>
</li>
{% endfor %}
</ul>"""
As mentioned in #55, instead of adding a new attribute directly, we could move to using a get_template method that could then be overridden to provide a template string directly.
Curious about this, but as I create the demo with a bunch of examples, a thought occurred to me: should a nav's template be allowed to be set on the nav itself?
Example: