NIXAID.COM was created as a place for sharing with the technical experience.
Would you like to have your article posted here? Feel free to drop me an email!
If you want to live a happy life, tie it to a goal, not to people or things.
April 21, 2016
I have migrated my blog from Pelican to Jekyll.
Below is the set of commands someone might find them useful when migrating from Pelican to Jekyll.
cd /srv/jekyll jekyll new . --force cd /srv/jekyll/_posts for post in $(find /old/pelican -name "*.md"); do date=$(grep -i "^date: " $post | awk '{print $2}'); if [[ ! -z $date ]]; then mv $post $date-$(basename $post .md).markdown; fi done for i in $(ls *.markdown); do sed -i -r '1s;^;---\nlayout: post\n;;s;(Tags: .*$)[^$]*;\1 \n---;' $i;done for i in $(ls *.markdown); do sed -i -re 's;^Slug: ;permalink: ;;s;^Title: ;title: ;' $i;done for i in $(ls *.markdown); do sed -i 's/^~~~bash/~~~/g' $i;done for i in $(ls *.markdown); do sed -i 's;{filename}\/files;{{ site.url }}\/assets;g' $i;done for i in $(ls *.markdown); do sed -i 's/^Tags: /categories: /g' $i; done for i in $(ls *.markdown); do sed -i '/^Author: .*/d;/^Date: /d' $i; done for i in $(ls *.markdown); do sed -i 's/^permalink: \([^/][^.]*\)/permalink: \/\1\//g' $i; done
Copy your static files (pdf, jpg, zip, …) to /srv/jekyll/assets/
cd /srv/jekyll mv /old/pelican/files assets chown jekyll:jekyll -Rh . jekyll build