Most users think of GitHub as an advanced file system, and that updating a GitHub hosted jekyll blog means uploading new content using
git. However, GitHub is actually an advanced document store with a REST API, event webhooks and other powerful features.
I host several blogs on GitHub, including most recently, the Flybase Blog, and I wanted a simple way to to be able to quickly add drafts or links via a bookmarklet, and so, this was born.
This is version 1, so there is room for improving, the next version will let you choose the post tags you want to use, whereas currently it defaults to
links. I’ll also probably include an option for setting the published status so you can send a post directly to publish if you want to, whereas they are currently set to
published:false as drafts until they can be reviewed.
- copy it in your Jekyll source folder,
- deploy the updates to GitHub, and
add-draft.htmlat your blog, usually at
Notes, ideas and thoughts
You will need to enter your GitHub username/password every time you post using the bookmarklet. This is a requirement (as far as I know) of the GitHub API. This is safe, as they are just sent to GitHub and no one else, but it’s not very convenient.
This was built quickly, and there is lots of space for improvements, like showing up tagging options, or identifying media in the page to be bookmarked (for example, photos or video embeds) and automatically generating different post types.