mdBook
How to embed LikeCoin button into mdBook
Last updated
How to embed LikeCoin button into mdBook
Last updated
Thanks to the user for providing the tutorial.
Before adding the LikeCoin button, please .
Follow the steps below:
Use JavaScript to create the HTML: In the browser, create the following HTML structure and put it into the static HTML created by mdBook:
Add the likebutton.js
: Place a file named likebutton.js
next to book.toml
in your custom-made mdBook. You can also use sdk.js
from the , as it works the same.
Here's an example of the likebutton.js code:
Edit the book.toml
: Open the book.toml
and add the following lines under the output.html
section:
Add the LikeCoin button to specific pages: In your markdown (md) files, add a <div> element with the class "likebutton" where you want the LikeCoin button to appear. For example:
The above instructions are for a single Liker ID. If you want to support multiple users, you can achieve it by using getElementsByClassName(LikerIDFoo).
Remember to build the mdBook and preview your website to see the LikeCoin button in action.
Copy and modify the CSS: Copy the file and rename it to become likebutton.css
. Make the following modifications: