Skip to content

如果是可继承类的模板呢? #11

@1166544

Description

@1166544

这种inject body和script标记的动态inject方式就不适用了吧?
因为nunjucks可以继承,一般头和公共部份都通过extends方式实现。即每个模板页有可能这个样子:

{% extends "../../layout/layout.tpl" %}

{% block content %}

{% include "../widget/item/item.tpl" %} {% if comments.length > 0%}
    [-] {{ comment.by }} {{ comment.time | relativeTime }}
    {{ helper.shtml(comment.text) }}
    {% endfor %}
{% else %}

No comments yet.

{% endif %}
{% endblock %}

请问如果是这种没有script和body标签的。该如何处理inject问题呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions