teles / link-builder

A automate link building tool perfect for front-end development

Home Page:https://codepen.io/teles/pen/KXaZjN?editors=1011

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Link Builder

Link Builder

The power to generate your html anchors using javascript.

Perfect for SPAs and SEO.

Common usage

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"
        }
    ]) 

Installation

npm install --save link-builder 

Or get the latest version from unpkg.com.

Parameters

There are two mandatory parameters for LinkBuilder.

content:

is any String or HTMLElement used as input for LinkBuilder.

replacements:

is a Array of Objects containing each one optional and required properties:

Properties for each replacement:

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

Examples

Coming soon

Contributing

Coming soon

License

MIT - Jota Teles - 2017

About

A automate link building tool perfect for front-end development

https://codepen.io/teles/pen/KXaZjN?editors=1011


Languages

Language:JavaScript 100.0%