Adds support for yaml files rather than yaml headers

master
Jonathan Hodgson 3 years ago
parent d3803d9d33
commit 51ca57da7f
  1. 10
      inc/yaml

@ -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(){

Loading…
Cancel
Save