Update frontmatter.sh
This commit is contained in:
@@ -23,7 +23,7 @@ is_true() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "Checking front matter"
|
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"
|
echo "Front matter (start) not found, adding it"
|
||||||
# Dont trace content, as its usually too large
|
# Dont trace content, as its usually too large
|
||||||
[ "$DEBUG" == "true" ] && set +x
|
[ "$DEBUG" == "true" ] && set +x
|
||||||
@@ -31,6 +31,8 @@ if ! head -n 1 "$file_path" | grep -q "---"; then
|
|||||||
[ "$DEBUG" == "true" ] && set -x
|
[ "$DEBUG" == "true" ] && set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cat $file_path
|
||||||
|
|
||||||
# Get the title from the front matter
|
# Get the title from the front matter
|
||||||
echo "Checking title"
|
echo "Checking title"
|
||||||
title=$($base_cmd '.title' "$file_path")
|
title=$($base_cmd '.title' "$file_path")
|
||||||
|
|||||||
Reference in New Issue
Block a user