Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

metalsmith-title

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith-title

A Metalsmith plugin that automatically add a title from processed file

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

metalsmith-title

A Metalsmith plugin that automatically add page title from first heading in processed file

Additionally has the option to remove title from document 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.

Installation

Using npm

  npm install metalsmith-title

Using yarn

  yarn add metalsmith-title

Usage

Extract the first tile from all (HTML and Markdown) files.

  const title = require('metalsmith-title');
  metalsmith.use(title());

Use the title in a metalsmith-layouts

	<title>{{ title }}</title>

The title can be removed from the file after extraction.

  const title = require('metalsmith-title');
  metalsmith.use(title({ remove: true }));

CLI Usage

Install via npm and then add the metalsmith-title key to your metalsmith.json

  {
    "plugins": {
      "metalsmith-title": true
    }
  }

License

MIT

FAQs

Package last updated on 19 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc