def write_front_matter(meta, style="toml"):
if style == "json":
import json
return json.dumps(meta, indent=4, sort_keys=True)
elif style == "toml":
import toml
return "+++\n" + toml.dumps(meta) + "+++\n"
elif style == "yaml":
import yaml
return "---\n" + yaml.dump(meta) + "---\n"
return ""
评论列表
文章目录