Created
August 12, 2014 00:42
-
-
Save dickfeynman/77307df43f1852a241d4 to your computer and use it in GitHub Desktop.
Fixing metadata for importing posts from Ruhoh to Hakyll
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/sh | |
# Strip single quotes of the date value | |
sed -i "/^date*/s/'//g" *.md | |
# Strip quotes off the tags list | |
sed -i "/^tags*/s/'//g" *.md | |
# Strip square brackets off the tags list | |
sed -i "/^tags*/s/\(\[\|\]\)//g" *.md | |
# Strip any blank lines among the first 5 lines | |
sed -i "1,5{/^$/d}" *.md | |
# Remove the categories | |
sed -i "/^categories/d" *.md | |
# Remove the type | |
sed -i "/^type/d" *.md | |
# Remove the description | |
sed -i "/^description/d" *.md | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment