I've modified the script to add the correct YAML header as well
file=$(echo "$( date '+%Y-%m-%d-' ){query}.md" | tr " " "-")
touch ~/<site>/_posts/"$file" && echo -e "---\nlayout: post\ntitle: "{query}"\ndate: $( date '+%Y-%m-%d %T' )\ncategories: \n---" > ~/<site>/_posts/"$file" && open -a "Byword" ~/<site>/_posts/"$file"