If you’re looking to start a blog, consider Jekyll. You’ll be able to publish on GitHub, GitLab, or any other host.
ThiefMD makes it easy to manage and update your site’s content.
This article assumes you already have a Git repository setup with your Jekyll install. Jekyll has an in-depth guide online here.
Creating a post is easy. Select _posts
in the Library, click on the New Post
icon, and enter in a filename YYYY-MM-DD-title
.
This will create a new markdown file for you to write in.
Each post begins with some YAML markup telling Jekyll the title, publish time, categories, and layout. Simply right-click and Insert YAML Frontmatter
, and ThiefMD will generate the front matter for you based on the current file. ThiefMD will only provide the minimum needed frontmatter. Need to update the post time of the article? There’s a menu item for that as well.
Front matter usually looks like:
---
layout: post
title: My Super Awesome Blog Post
date: 2020-10-05 11:38
---
If you’re using themes, the layout says what template to use. Most themes have page
and post
. The date
is the publishing time. Adding categories
can help readers find related posts or build good archive pages. tags
are also supported by Jekyll.
You can configure Jekyll so it won’t publish the post until after the date
. This makes it useful for drafting or scheduling articles.
You can read more in Jekyll’s Documentation. Many of these tips also work with Hugo and other static site generators.
By default, items in the _drafts
folder are excluded from being built and previewed. If you want the drafts folder to be included, you can add:
show_drafts: true
to your _config.yml
. This can be combined with future
or unpublished
. Learn more at Jykell’s Configuration Options.
If show_drafts
is not set in your _config.yml
, you can ask the serve command to render _drafts
.
jekyll serve --drafts
In your _config.yml
add:
future: false
This will prevent Jekyll from publishing any posts in the future. For previewing those posts, you can run:
jekyll serve --future
If you’re worried about accidentally publishing something, you can create posts in a _drafts
folder instead. Once you’re ready to publish, simply drag and drop the post from _drafts
to _posts
, then commit your changes.
Sort your files by Filename.
By default, files are created at the bottom of the Folder view. Sorting by Filename ascending will have your newer posts at the bottom of the screen.
Sorting by descending will have newer posts at the top, but any new post will be located at the bottom. Just re-run the sort, and your post will be right where you want it.
gitg is a free and useful tool for managing git repositories and committing your posts1. Sublime Merge offers more power and features but has too many features if you’re just blogging2. Learn X in Y Minutes has a great git write for the command line.
First, stage your changes. To stage your changes, double click on the post or right-click and choose “Stage changes”. This will store the current version of the file in Git’s history for version control.
Click commit
in the lower right corner once you’ve staged all the files you’ve modified.
After committing, you can go back into the timeline view to push your changes back onto the remote.