Last active
November 10, 2017 20:13
-
-
Save telnoratti/4b8fae6f8569769e66427df7b0486c43 to your computer and use it in GitHub Desktop.
Convert mynt posts to hugo
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 | |
files=$(ls | grep ^20) | |
for f in $files; | |
do | |
date=$(cut -f-3 -d- <<< $f) | |
sed -i "2i date: $date" $f | |
sed -i "3i lastmod: $(date --iso-8601=seconds)" $f | |
sed -i "4i draft: false" $f | |
sed -i '5i categories: ["Technology"]' $f | |
sed -i '/^layout.*$/ d' $f | |
mv $f $(cut -f4- -d- <<< $f) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment