add renaming script
This commit is contained in:
parent
393a4889b6
commit
5947ace2e4
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
POSTS_DIR="content/posts"
|
||||
|
||||
cd $POSTS_DIR
|
||||
for post in *
|
||||
do
|
||||
title=`sed -n 's/^title: "\?\(.*\)"\?$/\1/p' $post`
|
||||
safename=`echo $title | iconv -t ascii//TRANSLIT | tr '[:upper:]' '[:lower:]' | tr -s '[:punct:] ' '-' | sed 's/-*$//g;s/^-*//g'`
|
||||
mv $post $safename.md
|
||||
done
|
Loading…
Reference in New Issue