carlitoplatanito / gulp-nunjucks-render

[Gulp](https://github.com/wearefractal/gulp) plugin to render [Nunjucks](http://mozilla.github.io/nunjucks/) templates
149 stars 33 forks source link

How to include php syntax in nunjucks? #35

Closed kamlekar closed 8 years ago

kamlekar commented 8 years ago

In my project, I am trying to compile nunjucks file which is as follows:

stages.php

<?php
require_once 'index.php';
?>
{% extends "sections/_skeleton-content.html" %}
{% block content %}
<h1 class="stages-title">Stages</h1>
    <div class="tests-list-container"> </div>
{% endblock %}

stages.php (compiled)

<!DOCTYPE html>
<head></head>
<body>
        <h1 class="stages-title">Stages</h1>
            <div class="tests-list-container"> </div>
</body>

As you can see, the php syntax is disappearing in compiled file. How to solve this?