Skip to content
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

Jinja2's import directive isn't supported #63

Open
kkinder opened this issue Jul 28, 2020 · 0 comments
Open

Jinja2's import directive isn't supported #63

kkinder opened this issue Jul 28, 2020 · 0 comments

Comments

@kkinder
Copy link

kkinder commented Jul 28, 2020

  • pypugjs version: 5.9.4
  • Django version: N/A
  • Python version: 3.8.1
  • Operating System: Ubuntu Linux 20.04

Description

pypugjs doesn't seem to support Jinja2's import directive.

What I Did

Consider this example:

extends "base.html"
import "forms.html" as forms
block content
  | forms.render_form(form)

That should result in this:

{% extends "base.html" %}
{% import "forms.html" as forms %}
{% block content %}forms.render_form(form){% endblock %}⏎    

However, it results in this:

{% extends "base.html" %}
<import>"forms.html" as forms</import>{% block content %}forms.render_form(form){% endblock %}

You can get around it by using {% import ... %} in the pug template, but that's not really as elegant and JetBrains will complain about it too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant