diff --git a/src/drafts.ps b/src/drafts.ps index f9998f6..1dc308a 100644 --- a/src/drafts.ps +++ b/src/drafts.ps @@ -20,8 +20,13 @@ EOF # print list ls -r1 *.ps *.pm *.ph *.pa *.pt 2>/dev/null | fgrep '.draft.' | while read line do - TITLE="$(echo "${line%%.*}" | tr '_' ' ')" - URI="posts/${line%.*}.html" + if [ $(echo "${line##*.}") == "pm" ] + then + TITLE="$(head -1 "$line" | sed 's/^# //g')" + else + TITLE="$(echo "${line%%.*}" | tr '_' ' ')" + fi + URI="posts/${line%%.*}.html" cat < diff --git a/src/index.ps b/src/index.ps index de4c817..6cb1f29 100644 --- a/src/index.ps +++ b/src/index.ps @@ -20,7 +20,12 @@ EOF # print list ls -r1 *.ps *.pm *.ph *.pa *.pt 2>/dev/null | fgrep -v '.draft.' | while read line do - TITLE="$(echo "${line%%.*}" | tr '_' ' ')" + if [ $(echo "${line##*.}") == "pm" ] + then + TITLE="$(head -1 "$line" | sed 's/^# //g')" + else + TITLE="$(echo "${line%%.*}" | tr '_' ' ')" + fi URI="posts/${line%%.*}.html" cat <