參考:
目前本blogger簡易作法
引用:
<scriptsrc="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.6.4/showdown.min.js"></script><script>var converter = new showdown.Converter();var posts = document.querySelectorAll(".post-body,.snippet-item");Array.prototype.forEach.call(posts, function(el, i){if(el.innerHTML.indexOf("markdown") <= 1){el.innerHTML = converter.makeHtml(el.innerHTML.replace("markdown",""));}});var pres = document.querySelectorAll("pre");Array.prototype.forEach.call(pres, function(el, i){el.classList.add("prettyprint");});</script><scriptsrc="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js?skin=sunburst"></script>
之後在blogger側欄加入一個javascrpit的語法區塊。(放其他區塊也可以,放側欄 是因為這個版型每頁都有側欄。
沒有留言:
張貼留言