This repository includes two powerful tools for creating new Jekyll blog posts:
jekyll.thor) - Ruby-based solution with advanced featurescreate_post.sh) - Bash-based alternative for Unix/Linux/macOSThe Thor script is already configured and provides the most features:
# Create a new post
thor jekyll:new "Your Post Title"
# Create a draft
thor jekyll:draft "Your Draft Title"
# List all posts and drafts
thor jekyll:list
# Publish a draft
thor jekyll:publish "draft-filename.md"
# Create a new post
./create_post.sh "Your Post Title"
# Create a draft
./create_post.sh "Your Draft Title" --draft
# Create with tags
./create_post.sh "Your Post" --tags "tech,programming,linux"
# Specify custom date
./create_post.sh "Your Post" --date 2025-01-15
# Use different editor
./create_post.sh "Your Post" --editor vim
Both tools require:
_posts folderThe Thor script is already configured with the required gems in your Gemfile:
thor - Command-line interface frameworkstringex - String manipulation utilitiesThe shell script is ready to use:
# Make executable (already done)
chmod +x create_post.sh
# Test it
./create_post.sh --help
# Thor
thor jekyll:new "Getting Started with Docker"
# Shell
./create_post.sh "Getting Started with Docker"
# Thor
thor jekyll:draft "Advanced Docker Networking"
# Shell
./create_post.sh "Advanced Docker Networking" --draft
# Thor
thor jekyll:new "Kubernetes Best Practices" --tags "kubernetes,devops,containers"
# Shell
./create_post.sh "Kubernetes Best Practices" --tags "kubernetes,devops,containers"
# Thor
thor jekyll:new "Retrospective 2024" --date 2024-12-31
# Shell
./create_post.sh "Retrospective 2024" --date 2024-12-31
# Thor
thor jekyll:new "Vim Tips" --editor vim
# Shell
./create_post.sh "Vim Tips" --editor vim
# Use Cursor (default)
thor jekyll:new "My Post" # Opens in Cursor by default
./create_post.sh "My Post" # Opens in Cursor by default
Both tools create posts with this structure:
---
layout: single
title: "Your Post Title"
date: 2025-01-15
tags:
- tag1
- tag2
categories:
-
---
# Your Post Title
<!-- Add your content here -->
## Introduction
<!-- Write your introduction here -->
## Main Content
<!-- Write your main content here -->
## Conclusion
<!-- Write your conclusion here -->
Use the Thor script with default settings:
thor jekyll:new "Quick Tip: Git Aliases"
Create drafts for longer posts:
thor jekyll:draft "Comprehensive Guide to Jekyll"
# Work on it over time...
thor jekyll:publish "comprehensive-guide-to-jekyll.md"
Use tags for better organization:
./create_post.sh "Monitoring with Prometheus" --tags "monitoring,prometheus,devops"
export EDITOR=code (VS Code) or export EDITOR=vim--editor flag to specify manuallychmod +x create_post.shgem install thorbundle exec thor jekyll:new "Title"export EDITOR=cursor (Cursor) or export EDITOR=code (VS Code)--editor flag to specify manually--date 2025-01-15# Thor help
thor jekyll:help
# Shell script help
./create_post.sh --help
thor jekyll:new "Custom Layout Post" --layout post
./create_post.sh "Custom Layout Post" --layout post
thor jekyll:new "Multi-tag Post" --tags "tag1,tag2,tag3"
./create_post.sh "Multi-tag Post" --tags "tag1,tag2,tag3"
# Create multiple drafts
for title in "Post 1" "Post 2" "Post 3"; do
thor jekyll:draft "$title"
done
Feel free to enhance these scripts:
These scripts are part of your blog repository and follow the same license terms.