Skip to content

Instantly share code, notes, and snippets.

@kirang89
Created February 29, 2016 16:01
Show Gist options
  • Save kirang89/b119267cd60befebd94b to your computer and use it in GitHub Desktop.
Save kirang89/b119267cd60befebd94b to your computer and use it in GitHub Desktop.
Moving pelican posts to jekyll
#!/bin/bash
for post in $(find . -name *.md)
do
date=$(grep -i "date: " $post | sed -e "s/[dD]ate: \([0-9-]\+\).*/\1/g")
clean_date=$(echo $date | awk -F " " '{print $2}')
if [[ ! -z $clean_date ]]
then
cp $post /path-to-blog/_posts/$clean_date-$(basename $post)
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment