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

Jinja content not rendering correctly when using macros #18

Open
leogzyl opened this issue Jan 14, 2023 · 1 comment
Open

Jinja content not rendering correctly when using macros #18

leogzyl opened this issue Jan 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@leogzyl
Copy link

leogzyl commented Jan 14, 2023

I was trying out this plugin with the basic blog example from lektor quickstart and noticed that jinja content didn't work inside blog or blog post pages, but did work on the other pages.

Removing all macros from those pages, I can get jinja content to render correctly.

This doesn't work:

{% extends "layout.html" %}
{% from "macros/blog.html" import render_blog_post %}
{% from "macros/pagination.html" import render_pagination %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}
  {% for child in this.pagination.items %}
    {{ render_blog_post(child, from_index=true) }}
  {% endfor %}
  {{ render_pagination(this.pagination) }}
{% endblock %}

While this does:

{% extends "layout.html" %}
{% from "macros/blog.html" import render_blog_post %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}
  {% for child in this.pagination.items %}
    <a href="{{ child|url }}">{{ child.title }}</a>
  {% endfor %}
{% endblock %}

Is this a bug or something to be expected? Any other way to get macros to work?

@nixjdm nixjdm added the bug Something isn't working label Apr 19, 2023
@nixjdm
Copy link
Member

nixjdm commented Apr 19, 2023

I haven't tested this yet, but working through #19 there's a good chance this will be fixed as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants