From 16278eed2f9304c5158875f535f96f0c369a190a Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Tue, 26 May 2020 13:15:16 +0300 Subject: update --- build | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'build') diff --git a/build b/build index 72e4432..e1332f4 100755 --- a/build +++ b/build @@ -35,11 +35,11 @@ EOF } gettitle() { - sed 1q "$1" | grep -q '^Title:' || { - basename "$1" .md - return 0 - } - sed 's/^[Tt]itle: //;1q' "$1" + case "$(sed 1q "$1")" in + Title:*) sed 's/^[Tt]itle: //;1q' "$1" ;; + *) file=${1##*/} file=${file%.md} + printf '%s\n' "$file" + esac } genpages() { -- cgit v1.2.3