Bear Blog 好用工具

讓寫博客變得方便,就能寫得更多。 以及,寫博客的一大樂趣是裝修。

所以如果你也在 Bear Blog 建博客, 這裡整理了一些好用的工具,助力各位在 Bear Blog 玩得更開心(耍更久的廢)

快速編輯已發布的文章

在看自己的文章時,突然發現錯字,想馬上修改,但是打開 bearblog 的 posts 介面一篇篇去找又很麻煩。

在瀏覽器中添加一個書籤,在這個書籤的 URL 欄寫入下面的程式碼。 瀏覽自己的文章時,點一下這個書籤就能直接編輯目前看的文章。

javascript:  
username="YOUR_USERNAME";  
use_new_tab=false;  
/** gets the post's id from the analytics CSS */  
function get_post_id(){  
    f='token: "';  
    m=document.querySelector("body > main").innerHTML;  
    id=m.substring(m.indexOf(f)+f.length);  
    id=id.substr(0,id.indexOf('"'));  
    return id;  
}  
if (username=="YOUR_USERNAME")username = document.querySelector('meta[content="look-for-the-bear-necessities"]').getAttribute('name');  
/* gets the post id from the html markup of discoverable posts, or calls get_post_id() */  
post_id = document.querySelector('[name=uid]')?.value??get_post_id();  
/* Check if it's the home page */  
if (window.location.pathname == '/')path = "/dashboard/";  
else path = "/dashboard/posts/"+post_id+"/";  
/* open the edit post page */  
window.open("https://bearblog.dev/"+username+path, use_new_tab?"_blank":"_self");  

作者 ReedyBear 的貼文: Edit Current Post Button (如果上述程式碼不起效果,請參考帖子裡的解決方法)

Markdown 工具列

把下面這行程式碼粘貼到你的「Dashboard footer content」裡,就能在 Bearblog 的編輯器上方新增一個 Markdown 工具列。

<script src="https://flschr.github.io/bearblog-plugins/markdown-toolbar.js"></script>

「Dashboard footer content」在哪裡: dashboard 頁面 » Customise dashboard » Dashboard footer content

作者 René Fischer 的貼文: Markdown Power-Editor for Bear Blog

其他好東西

  1. 定制 404 頁面: CSS Override for Bear’s 404 Page
  2. 美化首頁文章列表(比如以卡片形態展示): Better Post List Styles
  3. 實時主題編輯器: bear.css.observer/。可以實時看到樣式的變化,不需要在 bearblog 的 style 頁面上反復發佈。
  4. 如果覺得 Bearblog 的用戶介面很難識讀 / 容易誤觸,可以進入 Bearblog 的 Customise dashboard 頁面,在 Dashboard styles 區域修改 Dashboard 的樣式。

除此之外,

?隨機抽選一篇