metalsmith-external-links
Processes HTML pages using Cheerio and modifies external facing link attributes.
Installation
$ npm install metalsmith-external-links --save-dev
Javascript Usage
Pass with options to Metalsmith#use
:
var extlinks = ; metalsmith;
Options
There are a couple options available to make external links more useful.
domain (required)
A string containing the domain name (name.ca) without protocol and www
. Example: npmjs.com
.
whitelist <String/Array>
A glob string or list of glob strings used to match urls.
rel
String used to change element rel
attribute, leaves rel
unchanged if set to undefined
.
target
String used to change element target
attribute, leaves target
unchanged if set to undefined
.
extClass
Class added to element when it's external, will leave class
unchanged if set to undefined
.
License
MIT