Update frontmatter.sh

This commit is contained in:
Stavros Kois
2024-05-13 01:29:53 +03:00
committed by GitHub
parent ac3fe05425
commit bd9cd57459

View File

@@ -23,7 +23,7 @@ is_true() {
}
echo "Checking front matter"
if ! head -n 1 "$file_path" | grep -q "---"; then
if ! head -n 1 "$file_path" | grep -q "^---$"; then
echo "Front matter (start) not found, adding it"
# Dont trace content, as its usually too large
[ "$DEBUG" == "true" ] && set +x
@@ -31,6 +31,8 @@ if ! head -n 1 "$file_path" | grep -q "---"; then
[ "$DEBUG" == "true" ] && set -x
fi
cat $file_path
# Get the title from the front matter
echo "Checking title"
title=$($base_cmd '.title' "$file_path")