Go Beyond

Written by Teran McKinney
/ About Me / Half-time Remote DevOps/Systems Engineer for $40,000 /

Conversion to Hugo

Hello Internet,

A directory listing wasn't quite as grand as I planned.

So, this is using Hugo now.

I realized I sometimes take the concept of one-liners a little too far. I wrote this to help with the conversion.

for i in *.txt; do (echo '+++'; grep -q ^tag $i && (echo -n 'tags = ['; for tag in $(grep ^tags $i | head -n 1 | cut -d '"' -f 2); do echo -n ' "'$tag'", '; done; echo ']'); echo 'title = "'$(cat $i | (grep -e ^title -e ^question | tr -d '\' | head -n 1 | cut -d '"' -f 2); cat $i | grep -q -e ^title -e ^question || basename $i .txt)'"'; echo $i | grep -q ^20 && echo date = \"$(echo $i | cut -d - -f -3 | cut -d . -f 1)\"; echo +++; cat $i) > $(basename $i .txt).md; done

Until next time,
Teran




Share on Voat.