このコードで「スタンドアロン」テンプレートをうまくレンダリングすることはできますが、テンプレートの継承を機能させることはできません。私が見落としているものや、誰かが知っている他の警告はありますか?
エラー:「.../views/index.html」の3行目に循環拡張が見つかりました!
app.js:
var express = require('express')
, cons = require('consolidate')
, http = require('http')
var app = express();
app.engine('html', cons.swig);
app.set('view engine', 'html');
app.set('views', __dirname + '/views');
app.set('view options', { layout: false });
app.get('/', function(req, res){
res.render('index.html', { header: 'Express' });
});
http.createServer(app).listen(3000, function(){
console.log("Express server listening on port 3000");
});
index.html
{% extends 'base.html' %}
{% block content %}<h1>{{ header }}</h1>{% endblock %}
base.html
<!DOCTYPE html>
<html>
<head>
<title>{% block title %}Express{% endblock %}</title>
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>