A automate link building tool perfect for front-end development
The LinkBuilder
function can be used as a constructor or literal function to parse any String
or HTMLElement
to include html anchors in it.
Use LinkBuilder
to easily include anchors to your markup, such as:
Before LinkBuilder:
<p> In the field of search engine optimization, link building describes actions aimed at increasing the number and quality of inbound links to a webpage with the goal of increasing the search engine rankings of that page or website.</p>
After LinkBuilder:
<p> In the field of <a href=\"https://en.wikipedia.org/wiki/Search_engine_optimization\">search engine optimization</a>, link building describes actions aimed at increasing the number and quality of <a href=\"https://en.wikipedia.org/wiki/Backlink\">inbound links</a> to a webpage with the goal of increasing the search engine rankings of that page or website.</p>
Used LinkBuilder
configuration to create above result:
new LinkBuilder(htmlContent, [{
anchor: "https://en.wikipedia.org/wiki/Search_engine_optimization",
keyword: "search engine optimization"
},
{
anchor: "https://en.wikipedia.org/wiki/Backlink",
keyword: "inbound links"
}
])
npm install --save link-builder
Or get the latest version from unpkg.com.
There are two mandatory parameters for LinkBuilder
.
content
:
is any
String
orHTMLElement
used as input forLinkBuilder
.
replacements
:
is a Array of Objects containing each one optional and required properties:
property | required | description | example |
---|---|---|---|
anchor | true | anchor text to be used as href | https://en.wikipedia.org/wiki/JavaScript |
keyword | true | String keyword to be matched | Javascript |
insensitive | false | Boolean to on/off case insentive match. Default false
|
true |
max | false | Number. Max number of matches for keyword . |
3 |
Coming soon
Coming soon
MIT - Jota Teles - 2017