I no longer use this project and do not maintain the code.
A Metalsmith plugin that automatically add page title from first heading in processed file
This clone of metalsmith-title adds an option to remove title after detecting it and setting it as metadata. Useful when you want to use markdown documents verbatim, but have special treatments for titles in your templates, such as putting them inside of
tags.$ npm install metalsmith-title
var date = require('metalsmith-title');
metalsmith.use(title());
That will add title to all
var date = require('metalsmith-title');
metalsmith.use(title({ remove: true }));
Install via npm and then add the metalsmith-title
key to your metalsmith.json
:
{
"plugins": {
"metalsmith-title": true
}
}
MIT