Add frontmatter to posts written for Chisel to be compatible with Jekyll or Hugo
Two scripts to run one after the other in the order shown:
cd posts
sh ../fm1.sh
sh ../fm2.sh
for f in *; | |
do sed '1i\ | |
title: ' < $f > tmp_$f ; | |
mv tmp_$f $f ; | |
done | |
for f in *; | |
do sed '2i\ | |
date: ' < $f > tmp_$f ; | |
mv tmp_$f $f ; | |
done | |
for f in *; | |
do sed '3i\ | |
tags: ' < $f > tmp_$f ; | |
mv tmp_$f $f ; | |
done | |
for f in *; | |
do sed '3G' < $f > tmp_$f ; | |
mv tmp_$f $f ; | |
done | |
for f in *; | |
do echo "---\n$(cat $f)" > $f; | |
done |
for f in *; | |
do sed '4G' < $f > tmp_$f ; | |
mv tmp_$f $f ; | |
done | |
for f in *; | |
do sed '5i\ | |
---' < $f > tmp_$f ; | |
mv tmp_$f $f ; | |
done |
# Update date line | |
for f in *; | |
do sed -E 's,([0-9]{2})/([0-9]{2})/([0-9]{4}),\3-\1-\2,g' < $f > tmp_$f ; | |
mv tmp_$f $f ; | |
done |
# Append timestap to date line | |
for f in *; | |
do sed '3s/$/T21:00:00+05:30/' < $f > tmp_$f ; | |
mv tmp_$f $f ; | |
done |
Add frontmatter to posts written for Chisel to be compatible with Jekyll or Hugo
Two scripts to run one after the other in the order shown:
cd posts
sh ../fm1.sh
sh ../fm2.sh