express-title

0.1.0 • Public • Published

express-title

NPM Version NPM Downloads Node.js Version Build Status Coverage Status

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())
 

MIT Licensed

Package Sidebar

Install

npm i express-title

Weekly Downloads

6

Version

0.1.0

License

MIT

Last publish

Collaborators

  • cjroth