我希望能够读取文件post.md
,如下所示:
title: Some Title
slug: some-title
author: Joe Smith
date: Jan 23 2015
tags: a, b, c, d
This is the first paragraph of the post.
This is another paragraph.
生成一个像这样的python字典:
post = {
"title": "Some Title",
"slug": "some-title",
"author": "Joe Smith",
"title": datetime.date(2015, 1, 23),
"tags": ["a", "b", "c", "d",],
"body": "This is the first paragraph of the post.\n\nThis is another paragraph."
}
可以稍微修改文件输入,但不能完全按照yaml,因为我想要降价突出显示。也许知道pelican's code base比我更好的人可以弄清楚它是如何在那里完成的。