0.1.0 • Published 11 years ago
express-title v0.1.0
express-title
Fill in your <title> tags via middleware.
Add it as middleware:
app.use(require('express-title')());Set a base title:
app.set('title', 'Epic Website');Add page titles:
app.get(function(req, res, next) {
res
.title('What an awesome title?!')
.render('template');
});Add title to your view:
doctype html
html(lang='en')
head
title= title
body
//- ...Now you've got beautifully dynamic page titles:
<title>What an awesome title?! · Epic Website</title>Bonus: use a custom formatter:
app.use(title('%base% - %title%'));Installation
$ npm install express-titlevar title = require('express-title');
// ...
var app = express();
// ...
app.use(title())MIT Licensed
0.1.0
11 years ago