This is a simple cli post creator for Jekyll blogs. I've done it because I really like Jekyll as a blogging platform but creating a new article is really pain in the ass.
A markdown file, named with date-title.md
that will be placed in the _posts
subfolder of your local blog.
The content of the file might be something like that:
FYI, I use the Travelogue template, which is why I need those fields.
---
layout : post
date : 2015-06-16
title : hello world
thumb : ../img/2015/06/16/Capture d’écran 2015-06-16 à 09.48.33.png
background : None
show_tags : false
show_categories : false
excerpt : "this is the excerpt"
author : "Jonathan"
---
* TOC
{:toc}
![](../img/2015/06/16/_NIK4279.jpg)
![](../img/2015/06/16/_NIK5198-2.jpg)
First, you need to edit the settings/settings.ini
file:
Then, in a terminal, launch jekyllpost.sh
with few arguments:
Mendatory arguments for creating a new post:
Optional arguments:
When you specify an image with thumb, backgroung or images, if the image starts by http
, just a link will be created in the documents, but if it's a local file, it will be copied in the img
subfolder of your blog, inside a subfolder hierarchy relative to current date.
Exemple:
If today is the 16th of June 2015, the image will be copied to:
/user/john/Documents/myBlog/img/2015/06/16/imageName.jpg
It's important to note that an image filename cannot start by an underscore like _NIK4279.JPG. It messes with Jekyll serve...
If you do not want to create an article, but just copy some images into the right date-formated subfolder stuff, you can use Jekyllpost just like that:
jekyllpost -images /Users/jonathanlurie/Desktop/NIK7649.jpg http://www.creativeapplications.net/wp-content/uploads/2015/06/nypl.jpg
Once again, the distant (http) images wont by copied.