Write.as
如何在 Write.as 文章中加入 LikeCoin button
此文檔只適用於 Liker Land 和 LikeCoin v2。如需了解 3ook.com 和 LikeCoin v3,請至 docs.3ook.com 及 dao.like.co。
感謝用戶 夏 的教學範本。
安裝讚賞鍵以前,請先 註冊 Liker ID。
首先你需要加入 Write.as Pro 服務方可使用 Javascript。
把 Javascript 程式碼中的 [LikerID] 更改為你的 Liker ID,再將它黏貼到 Write.as 設定裡的 "Custom Javascript" 欄位,有需要可加入 CSS 調整版面字型等樣式即可。
var topP = document.createElement("p");
topP.innerHTML = '<div class="custom-nav"><a href="#">Back to top ↑</a></div>';
var cont = document.getElementById("wrapper");
if (cont !== null) {
// Add to blog index and tag pages
cont.appendChild(topP);
} else {
// Add to individual blog post page
cont = document.getElementById("post-body");
cont.insertAdjacentHTML("afterend", topP.outerHTML);
cont.insertAdjacentHTML("afterend", "<div class='custom-nav likecoin'><p>-<br><em>如果你喜歡我的文字,請幫忙按 5 下 Like!我將得到 LikeCoin 的回饋。</em></p><p>回饋由 <a rel='nofollow' href='https://like.co/'>LikeCoin</a> 基金會出資,只要註冊/登入帳號,點 5 下 Like 就可以贊助我的文章。化讚為賞,支持創作。謝謝你!</p><iframe scrolling='no' frameborder='0' width='640' height='212' src='https://button.like.co/in/embed/[LikerID]/button?referrer="+encodeURIComponent(location.href.split("?")[0].split("#")[0])+"'></iframe></div>");
}
參考文章
Last updated