I want to setup an application where I can write as much html over jade as possible. I don't dislike jade, I just want to write html/angular/node APIs, since I'm learning a lot of technologies at once (angular, node, jade, etc).
I would like to build a skeleton project like the following:
Static (server built pages using jade or html) for SEO (basic business card pages). i.e. sitename.com/about, sitename.com/
angular driven admin area (i.e. sitename.com/admin), that is a single html file with embedded angular views/partials.
Should I just learn jade, or attempt to use this mixed approach? I have the first part (simple jade static pages).
Express is pretty template-agnostic, in that you can choose any templating engine you like. If you want more HTML-style templates, you could use ejs instead of Jade, for instance:
// install ejs first
npm install ejs
// app.js
var express = require('express');
var app = express();
app.engine('html', require('ejs').renderFile);
app.set('view engine', 'html');
app.get('/', function(req, res) {
res.render('index', { name : 'World' });
});
app.listen(3012);
// ./views/index.html
<h1>Hello <%= name %>!</h1>
// Output:
<h1>Hello World!</h1>
You can include html files in jade. Just write include path-to-file