express-title
v0.1.0
Published
middleware for title tags
Downloads
18
Maintainers
Readme
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-title
var title = require('express-title');
// ...
var app = express();
// ...
app.use(title())