I put this in my .bash_profile
:
blog () {
file=~/blog/_posts/$(date +'%Y-%m-%d-')$(echo $@ | tr A-Z a-z | [sed](/wiki/#sed) -e 's/ /-/g').md
echo --- > ${file}
echo title: $@ >> ${file}
echo date: $(date +%Y-%m-%dT%H:%M:%S%z) >> ${file}
echo layout.html: post >> ${file}
echo --- >> ${file}
echo >> ${file}
${EDITOR} "+normal Go" +startinsert! ${file}
}
Where ~/blog
is where my jekyll blog lives. Then I can just type
blog Here is my shorthand for creating a jekyll blog post
and it'll create a file for me in the right place, with the right name and date and title and so on and I can start typing... I may extend this.
Incidentally MAN ALIVE I am hating "kramdown" for markup, jekyll is turning it into some properly unwieldy html with unnecessary classes... so now replaced it with "rdiscount". As I think I said before I am trying to remove all classes from this site. With about 90% success so far...
Paulʼs blog - I live in A sleepy town in the far South. Wed + dad to two, I'm a full-stack web engineer, and I do js / node, some ruby, other languages ect ect. My hobbies are pubs, parkrun, restaurants, home automation 🤖 and other diy jiggery-pokery, history, family tree stuff, TV, squirrels, pirates, lego, and TIME TRAVEL.