Adds support for yaml files rather than yaml headers

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

@ -6,8 +6,14 @@ getYamlBlock(){
local filename local filename
filename="$(findFile "$1")" filename="$(findFile "$1")"
sed -n '1 { /^---/ { :a N; /\n---/! ba; p} }' "$filename" | # If there is a yaml file, use it
sed '1d;$d;s/\t/ /g' # 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(){ getYamlTitle(){

Loading…
Cancel
Save