Skip to content

Instantly share code, notes, and snippets.

@arnab
Last active December 11, 2015 10:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arnab/4584901 to your computer and use it in GitHub Desktop.
Save arnab/4584901 to your computer and use it in GitHub Desktop.
Things I had to do "differently" to migrate site to octopress
# Without setting thr LANG, I'd get errors from Ruby like this:
# YAML Exception reading 2012-09-23-state-of-e-commerce-in-india.md: invalid byte sequence in US-ASCII
# /Users/arnabdeka/Dropbox/websites/arnab.github.com/plugins/backtick_code_block.rb:13:in `gsub': invalid byte sequence in US-ASCII (ArgumentError)
# from /Users/arnabdeka/Dropbox/websites/arnab.github.com/plugins/backtick_code_block.rb:13:in `render_code_block'
# ...
# I got the idea while reading this rubygems issue: https://github.com/rubygems/rubygems/issues/314
export LANG=en_US.utf-8
for file in source/**/*.md; do
mv $file $file.tmp;
awk '/---/&&v++%2{sub(/---/, "comments: true\n---")}{print}' $file.tmp > $file;
rm $file.tmp;
done
git st
git diff -b # verify all good.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment