mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Use docinfo fields instead of comments.
This commit is contained in:
parent
ed021f02c9
commit
3ea2968a83
5 changed files with 15 additions and 15 deletions
|
|
@ -224,7 +224,7 @@ def read_settings(filename):
|
|||
context[key] = tempdict[key]
|
||||
return context
|
||||
|
||||
_METADATA = re.compile('.. ([a-z]+): (.*)', re.M)
|
||||
_METADATA = re.compile(':([a-z]+): (.*)', re.M)
|
||||
_METADATAS_FIELDS = {'tags': lambda x: x.split(', '),
|
||||
'date': lambda x: get_date(x),
|
||||
'category': lambda x: x,
|
||||
|
|
@ -252,7 +252,7 @@ def parse_metadata(string):
|
|||
"""
|
||||
output = {}
|
||||
for m in _METADATA.finditer(string):
|
||||
name = m.group(1)
|
||||
name = m.group(1).lower()
|
||||
value = m.group(2)
|
||||
if name in _METADATAS_FIELDS:
|
||||
output[name] = _METADATAS_FIELDS[name](value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue