Created
February 29, 2016 16:01
-
-
Save kirang89/b119267cd60befebd94b to your computer and use it in GitHub Desktop.
Moving pelican posts to jekyll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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