Leanpub Affiliate Links for GitBook
This plugin allows you to add Leanpub affiliate links to the bottom of every page in your gitbook.
Install as a global NodeJs package.
$ npm install -g gitbook-plugin-leanpub-affilate
Use in a gitbook
To use in your book, add to plugins list in
book.json in your gitbook directory:
You can configure the plugin is
- Gets suffixed to every affiliate link
- For example, the above config means that
?a=27hVMyWVn46xaZCi6E563X&subID=gitbookPluginwill get added to very link
- Whether or not images should be displayed, and their dimensions
- The number of affiliate links to display per page
- Not all links will be picked for display, by default, just twice of the count per page
- Specify the total number of links to randomly select for display across all pages in the gitbook
- An array of links that should always be included
- Use these for your favourite books
The appearance of the list of Leanpub affiliate links at the bottom of each page is rudimentary.
Please add CSS styles to the theme you are using to achieve the intended styling effect.
book/plugin.css for an example.
If you experience problems with the plugin not having any effect at all,
i.e. the links do not appear at the bottom of each page,
please check your
If gitbook fails to parse that file, it will silently fail,
rendering all the pages without any plugins or themes.
This affects all gitbook plugins, not just this one.
Contributions welcome, of course!