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

Using Nunjucks inheritance #7

Closed
reinoute opened this issue Jun 19, 2018 · 1 comment · Fixed by #11
Closed

Using Nunjucks inheritance #7

reinoute opened this issue Jun 19, 2018 · 1 comment · Fixed by #11
Labels

Comments

@reinoute
Copy link

Is there any way I can get Nunjucks inheritance (extends) to work?

It looks like the plugin uses Nunjucks renderString to parse the template (and not the FileSystemLoader).

If it's not possible, is there an alternative way to achieve having 'master' templates such as the example below?

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        {% block header %}{% endblock %} 
    </head>
    <body>
        {% block content %}{% endblock %} 
    </body>
</html>
@reinoute reinoute changed the title Using Nunjucks templates Using Nunjucks inheritance Jun 19, 2018
@chocolateboy
Copy link
Owner

chocolateboy commented Sep 19, 2018

Probably an instance of this bug. Inheritance with extends works fine for me, but only if referenced files are in the same directory. Ditto import and include.

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

Successfully merging a pull request may close this issue.

2 participants