Blog2018 ≫ Here is my shorthand for creating a jekyll blog post

I put this in my .bash_profile:

[blog](/wiki/#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 Clarke's blog - I live in Hythe in the far South. Married + dad to 2, I am a full stack web engineer, + I do js / Node, some ruby, other languages etc. I like pubbing, running, eating, home automation and other diy jiggery-pokery, history, genealogy, Television, squirrels, pirates, lego, and TIME TRAVEL.