To correct the date format for permalinks:
find -type f -exec sed -i 's/\([0-9]\+-[0-9]\+-[0-9]\+\).*$/"\1"/' {} \;
To replace the {%img ... %}
macro from Jekyll:
find -type f -exec sed -i 's/{% *img \([^ ]*\) \(.*\) %}/{{%img src="\1" caption="\2" }}/' {} \;
To convert all tabs to 4 spaces:
find -type f -exec sed -i $'s/\t/ /g' {} \;
To get rid of {% raw %} ... {% endraw %}
blocks:
find -type f -exec sed -i '/{% raw %}/d' {} \;
find -type f -exec sed -i '/{% endraw %}/d' {} \;
To get rid of date in the filenames for posts:
for file in $(ls); do
git mv ${file} ${file:11};
done
Note that these assume GNU sed and find, so if you're on Mac you'll need to either adapt them to BSD tools or install the GNU versions.