I use Bear almost every single day. I use it for journaling, writing down ideas, brainstorming, creating lists, and documenting my work.
Personally, I love Bearâs UI. Itâs simple and unobtrusive. It does exactly what you need it to do, and doesnât get in your way.
When I write in it, it just FEELS like Iâm way more productive (even when Iâm probably not), and my ideas seem to flow seamlessly from brain to Bear versus some other writing apps that Iâve tried in the past.
But, as much as I love using Bear for writing, thereâs one major thing that I still have yet to fully utilize Bear for: blogging.
More specifically, using Bear for blogging on static sites like Gatsby, Jekyll, or Hugo
The blog youâre reading right now is custom static site built with a popular framework called Gatsby.
Without getting into too much detail here, static sites are basically a set of pre-built HTML files that can be immediately served to a browser, much like they were back in the 90s.
Serving pre-built files means that the server doesnât have to rebuild the HTML each time a user wants to visit a page on your site. This means your site loads can be very fast.
It also means the website servers themselves donât need a lot of processing power. They can be extremely low-cost (nearly free), âdumbâ servers at a fraction of the price of traditional virtual private servers (VPS), which are necessary for Wordpress sites.
Static sites are becoming increasingly popular for their speed and scalability, versus other non-static platforms (eg Wordpress) that require more server horsepower as you scale in users.
Over the past few years, Iâve been experimenting with static sites for blogging. While they arenât a panacea, they are definitely something worth paying attention to.
I happen to manage a few sites built on static site technology, and Iâve always wanted a way to combine the excellent writing experience of Bear with all the benefits of static site generators like Gatsby, Jekyll, or Hugo.
Before I begin, I realize that there might be other automated solutions, hacks, or perhaps apps to manage blogging with Bear.
However, this post discusses the 3 main issues that Iâve experienced using Bear for blogging, which are:
Finally, Iâll discuss my own personal solution that Iâve developed, bearblogr.
Letâs get started! đ
Static site generators work by taking your markdown files containing your content, and then generating static HTML files for your blog post or other individual pages on your site.
Markdown files used by most static site generators typically contain something called âfrontmatterâ.
Frontmatter is additional metadata that stores information such as the authorâs name, published timestamps, paths to a post image, the path/slug desired for your post, etc.
Hereâs an example of frontmatter from one of my other blog posts:
---
title: Create QR Codes With qrencode
subtitle: For sharing URLs, WiFi, Bitcoin, and all your hacking needs
path: /post/create-qr-codes-with-qrencode-for-sharing-urls-wifi-bitcoin-and-all-your-hacking-needs
date: 2020-09-01T17:03:12.246Z
author: Neo
layout: blog
tags:
- devops
- hacks
---
Without any explanation at all, itâs easy enough to determine what each line in the frontmatter is used for.
Simple enough, right?
Frontmatter is custom, and is usually something that your Content Management System (CMS) or static site generator handles for you. However, most frontmatter is easily understood, and can be edited without need for a CMS.
So, why even bother using a CMS then? Why not just use your favorite writing app for blogging?
You most certainly can! But before I discuss the process of generating markdown and frontmatter easier, I want to talk a bit about CMSs.
CMS platforms were designed to help creators manage their content. CMSs like NetlifyCMS are free and are easy to set up.
But, CMS editors arenât designed for writing.
Also, many CMSs are hosted online, which means you have to be connected to the Internet to draft a blog post. This isnât necessarily a huge issue, but it isnât always the most convenient thing for writers. Especially when an idea strikes you out of nowhere, and you have to get it down; Internet connectivity or not.
Writing is a highly creative process, and the quality of tools used for creating anything almost always matter.
Bear IS designed for writing and it works offline. But unfortunately Bear doesnât support static blogging platformsâŚyet.
While Bear does support copying/exporting to markdown, this is only half the battle. Getting your Bear note into a format that a static site generator can accept is a hassle, especially when you might need to frequently change your content.
Which brings us to The Cloud Problem.
I love that anytime I want to update my site, I can *seamlessly* copy and paste my content, then add my frontmatter, save it to a file, then commit, then push to git, then preview the draft..
â No One Ever
If you have ever tried to handle/sync multiple copies of a document living in different places, youâll quickly realize that itâs not just a simple matter of copy and paste.
my-first-blog-post.md
my-first-blog-post-june.md
my-first-blog-post-july.md
my-first-blog-post-final-july.md
my-first-blog-post-final-final-july.md
my-first-blog-post-SERIOUSLY-final-final-july.md
Does this sound familiar?
But for the sake of argument, letâs assume wrangling your content and markdown files by hand isnât an issue for you. Youâre a master at CTRL+c
and CTRL+v
. Hell, you can do CTRL+x
while sipping your morning coffee and petting your dog.
â¨ď¸ + â +đ
Unlike Wordpress, thereâs a couple more steps that you still need to go through in order to make your blog post live on most static sites.
If you have a static site for blogging, you still have to pull your latest Git repository from your remote.
Copy your newly created markdown files to the appropriate path in your static site repo.
Do a Git commit.
Push your Git repo.
Rebuild your site.
Then check to make sure that everything still worksâŚ
Every. Single. Time. You update your blogâs content.
Yes, these arenât huge steps, but over time, they all add up and take time.
Time away from your writing and creative process.
I didnât even mention managing multiple site repos, or if you store your content somewhere else in the cloud (eg. an AWS S3 bucket).
Given all of the above pain points that Iâve run into with using Bear for static site blogging, I figured that there might be an easier wayâŚ
The premise for bearblogr is simple: it publishes your content from Bear to your static blog in the fewest steps possible.
Is solved by embedding a special code block that contains your frontmatter inside your Bear note.
Is solved with Bear! Bear is now your blogâs centralized content management system, that works both on/offline, and on all your devices.
Is solved with another embedded code block that knows how and where to push your blog post when youâre ready to publish. Meaning you can manage content for multiple blogs or sites from within a single Bear account.
In short, bearblogr enables you to use Bear as your CMS for one, or multiple static sites.
This allows you to create/organize/tag your content in Bearâs familiar UI, and when youâre ready, export and publish your content into the cloud (Git or S3).
Meaning you can stay focused on creating your content, and not worry about versioning, or how to get it to your blog in the right format.
bearblogr makes the process of creating and updating content on static sites as simple as possible by automating common tasks away.
bearblogr uses a few special embedded code blocks inside your note which are not natively supported by Bear, parses them, and automates the process of publishing your content in the right format.
This is the current workflow for writing and publishing a blog post using bearblogr:
Updating a blog post is even easier. Simply make your changes in Bear and click âUpdateâ.
If you have multiple blogs, you can create Bear notes to act as templates, so that most settings in steps 1-3 only need to be written once.
Since each note contains itâs individual configuration, thereâs no more confusion about how or where to upload your content once youâre ready to publish.
bearblogr was created to scratch my own personal itch.
No one asked me to create bearblogr, nor does Bear (Shiny Frog) or anyone else sponsor my work. Itâs something I needed and really wanted, so I just built it.
I realize that the problems described in this post may or may not be the same problems that you might have.
But, if the problems I described resonate with you and you havenât yet found a suitable solution, perhaps bearblogr is for you.
Iâm hoping to build updated releases for the Bear and static site communities since theyâve been so kind and generous to me over the years.
Signup for my newsletter below, or simply follow this blog, and stay in touch on social media.
Activity on social media is the only way for me to know that people are interested and want bearblogger.
I would love to hear more from you about:
Hit me up on Twitter @neooeevo!
Or, you heard about this on Reddit or somewhere else, post a message and let me know what you think!
Thanks for reading!
Cheers, Neo