2 unstable releases
Uses new Rust 2024
| 0.2.0 | Jan 26, 2026 |
|---|---|
| 0.1.0 | Nov 25, 2025 |
#180 in Template engine
30KB
830 lines
CraBlog
This is a simple command-line tool to assist with writing blogs.
CraBlog lets you write blogposts in MarkDown, a simple markup language used all over the internet. From there, it lets you use a single command to transform those MarkDown files into an HTML file (with templating provided by Minijinja) and into an Atom feed.
Getting Started
First, initialize a directory using crablog init.
$ crablog init --author "Your Name Here"
This will create a crablog.toml file, which will contain configuration options and allow you to customize your feeds.
To create a post, first write up a simple markdown file:
# My First Blogpost!
This is my first blogpost using CraBlog!
Then, use crablog post to render this markdown file into an HTML file, and add it to your Atom feed.
$ crablog post --md my_first_blogpost.md --title "My First Blogpost!" --feed my_feed
FAQ
Q: Aren't there tools to do this already?
A: Theoretically yes, but making a custom one allowed me to tailor it to my specific needs.
Q: What is Minijinja, and why does CraBlog use it?
A: Minijinja is a templating language, meaning you can use it to modify a text file with dynamically-loaded data. There are several templating languages available for Rust, but Minijinja was picked for a few reasons:
- Few dependencies, meaning faster compilation time
- Nearly identical to jinja2, a popular Python templating language
- Unlike several Rust-based templating language, the templating occurs at runtime, so users can write their own templates
- Relatively fast execution speed
Q: Why Atom instead of RSS?
A: Atom is a (slightly) newer alternative to RSS, aimed at doing the same task: sharing content between websites. While RSS is typically more widely known, Atom has a few advantages over RSS, namely in that it sticks with standards more closely. This, along with the fact that nearly all RSS readers support Atom as well, means that there is no real reason for CraBlog to support RSS.
Dependencies
~12MB
~251K SLoC