From cf4a147140d6bfebf94fb71e53e0f68fbd13c2e1 Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Fri, 3 Nov 2023 13:48:18 +0100 Subject: [PATCH] Update 2023-11-03 13:48:17 --- src/drafts.ps | 9 +++++++-- src/index.ps | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) 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 <