falkon.sgorava.xyz/convert.sh

6 lines
333 B
Bash
Raw Normal View History

#!/bin/bash
find content/qml -type f -name "*.md" -exec sed -i '1 s/#/---\ntitle:/; 1 s/.*[^0-9]\([0-9]\+\)[^0-9]*$/\0\nnumber: \1/;1 s/$/\n---\n/; s|\.\./|/|g' {} \;
find content/python -type f -name "*.md" -exec sed -i '1 s/#/---\ntitle:/; 1 s/.*[^0-9]\([0-9]\+\)[^0-9]*$/\0\nnumber: \1/;1 s/$/\n---\n/; s|\.\./|/|g' {} \;
exit 0