Skip to content

Instantly share code, notes, and snippets.

@telnoratti
Last active November 10, 2017 20:13
Show Gist options
  • Save telnoratti/4b8fae6f8569769e66427df7b0486c43 to your computer and use it in GitHub Desktop.
Save telnoratti/4b8fae6f8569769e66427df7b0486c43 to your computer and use it in GitHub Desktop.
Convert mynt posts to hugo
#!/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