The following scripts are extentions for the Bear Blog platform. These are not official extensions to Bear and may need a bit of tweaking here and there. Consider contributing!
They are separated into Blog and Dashboard tools to distinguish if they are used on the rendering of the blog, or if they are an extension to the Bear editor and dashboard.
These extensions can be used by copying and pasting the JS into a <script></script> tag in the footer directive of your blog.
Copying the code is preferred over linking via the GitHub CDN
- It gives you more control over the script which can be modified as you see fit
- It loads instantly without additional network requests
- It prevents plugin updates from negatively affecting your blog
Add pagination to blog page and post embeds instead of displaying all posts at once.
Display the estimated reading time for a post.
Search post titles on the blog page with a search input.
Easily open the post or homepage editor using Ctrl + E
Adds a button to code blocks to easily copy the content.
Add a password to a blog in order to view the content.
Note: This is circumventable by anyone with a decent understanding of JavaScript and so should only be used to protect non-sensitive information.
Generate a table of contents at the top of a post based on the titles in the post. Configuration at top of script.
Redirect a custom domain blog with a www subdomain to the root domain.
*Note: This is best added to the <head> section instead of the <footer> section since it needs to execute immediately.
These scripts can be added to the footer of your dashboard in a <script></script> element.
Store a version history in browser for easy recovery of older versions of posts
Expands the post and homepage content editor to the bottom of the screen.
Adds syntax highlighting and shortcuts for markdown features.
Note: Overtype has been deprecated and it is instead suggested to use the Markdown power-editor by René.
Count and display total posts and pages in the dashboard.
Automatically ensures all lines have two spaces at the end, so Markdown will render new lines. Without two spaces at the end, text written on different lines (without a blank line between them) will render in your post as being on one line.