diff --git a/build.sh b/build.sh index d8d0bbe..71f9afa 100755 --- a/build.sh +++ b/build.sh @@ -91,7 +91,7 @@ del_files_in_output() { read_metadata() { # Read the metadata from the top of a .md file into a string - metadata=$(awk 'BEGIN{RS = "\n\n"} {print $0}; {exit}' "$1") # Reads from the .md file until a double-newline is encountered + metadata=$(awk 'BEGIN{RS = "\n\n"} ($0 != "") && ($0 !~ /^---/) {print $0; exit}' "$1") # Reads from the .md file until a double-newline is encountered, as long as 1) the text read is non-empty and 2) it doesn't start with a triple hyphen (the triple hyphen denotes a pandoc metadata block) } convert_to_array() {