Skip to content

Jinja support #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
HiPhish opened this issue Mar 19, 2025 · 4 comments · May be fixed by #170
Open

Jinja support #165

HiPhish opened this issue Mar 19, 2025 · 4 comments · May be fixed by #170
Labels
👶 good first issue Good for newcomers 🕵️ needs research Issue that requires further investigation or information gathering 🧪 needs tests Feature or change that requires additional tests 🙌 up for grabs Issues not currently being pursued, but are open for external contributions

Comments

@HiPhish
Copy link

HiPhish commented Mar 19, 2025

Hello,

is this library compatible with Jinja? I have been able to use it with Django templates just fine, but when I wanted to try it in a Jinja template this part stumped me:

{% load django_simple_nav %}

{% block navigation %}
<nav>
  {% django_simple_nav "path.to.MainNav" %}
</nav>
{% endblock navigation %}

I cannot use load in Jinja, so I guess there must be another way to get django_simple_nav into the template. Is it possible to use Jinja, and if not, then what would it take to get Jinja compatibility?

@joshuadavidthomas
Copy link
Member

TBH, I'm not sure! I've never bothered trying to use the Jinja template engine when using Django. This library isn't doing anything crazy, so I imagine it should be compatible, but I honestly don't know.

@joshuadavidthomas joshuadavidthomas added 🕵️ needs research Issue that requires further investigation or information gathering 👶 good first issue Good for newcomers 🧪 needs tests Feature or change that requires additional tests 🙌 up for grabs Issues not currently being pursued, but are open for external contributions labels Mar 20, 2025
@joshuadavidthomas
Copy link
Member

Since I don't use the Jinja engine, I'm not sure how much capacity I have to investigate this. A quick search led me to this page on the Jinja docs: Writing Extensions.

@HiPhish
Copy link
Author

HiPhish commented Mar 20, 2025

Would you accept a contribution to add Jinja support? I cannot promise if and when I am going to make it work, but I can try if you are willing. In my personal opinion Jinja is better suited for larger projects, and it is included in Django by default, so it does make sense to support it out of the box.

@joshuadavidthomas
Copy link
Member

Since it's included in Django core I think jinja should absolutely be supported. So if you're up for it, I'm game too! 😄

@HiPhish HiPhish linked a pull request Apr 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👶 good first issue Good for newcomers 🕵️ needs research Issue that requires further investigation or information gathering 🧪 needs tests Feature or change that requires additional tests 🙌 up for grabs Issues not currently being pursued, but are open for external contributions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants