Adds support for yaml files rather than yaml headers

This commit is contained in:
Jonathan Hodgson 2020-12-29 08:45:14 +00:00
parent d3803d9d33
commit 51ca57da7f

View file

@ -6,8 +6,14 @@ getYamlBlock(){
local filename
filename="$(findFile "$1")"
sed -n '1 { /^---/ { :a N; /\n---/! ba; p} }' "$filename" |
sed '1d;$d;s/\t/ /g'
# If there is a yaml file, use it
# if not, try and get the yaml header
if [ -f "$filename.yaml" ]; then
cat "$filename.yaml"
else
sed -n '1 { /^---/ { :a N; /\n---/! ba; p} }' "$filename" |
sed '1d;$d;s/\t/ /g'
fi
}
getYamlTitle(){