GithubHelp home page GithubHelp logo

Comments (5)

ceymard avatar ceymard commented on July 17, 2024

Can you give me a way to reproduce the error so that I can look into it ?

from node-jinjs.

 avatar commented on July 17, 2024

I modify the lib/express.js at the line 34 as res = expressEnvironment.superclass.prototype.getTemplateFromString.call(this, str, ctx);

the original is : res = ExpressEnvironment.superclass.prototype.getTemplateFromString.call.call(this, this, str, ctx);

the same as lib/express.js line 23: return ExpressEnvironment.superclass.prototype.trackFile.call(this, path);

all is OK!!

The way is following your guide:
#npm install jinjs

and my express config is that:
var jinja = require('jinjs');
app.register('.html', jinja);
app.set('views', __dirname + '/../../app/views');
app.set('view engine', 'html');
this.set('view options', {layout: false});

and I DON'T use precompiling with pwilang, because if use, it issued some other bug as followings:

layout.html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{% block title %}{{PAGE_TITLE}} | {{ SITE_TITLE }}{% endblock %}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
....
<style type="text/css">
#page {
margin-top: 0;
}
</style>
</head>
<body>
<div id="page" class="container ">
<div id="header">
{% block header %}
{% include "../common/header.html" %}
{% endblock %}
</div>
</div>
</body>
</html>

and the css style part in the ultimate rendered page will be like this:
.....

<style type="text/css">
<div id="page">{
margin-top: 0;
}
</style>

....

when I disable pre-compiling, the problem gone!

from node-jinjs.

ceymard avatar ceymard commented on July 17, 2024

I'm going to remove the pwilang precompilation entirely, as it obviously only is confusing...

from node-jinjs.

ceymard avatar ceymard commented on July 17, 2024

Latest version should work.

from node-jinjs.

 avatar commented on July 17, 2024

OK, thanks. All work now.

This issue can be closed

from node-jinjs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.