1
0
Fork 0
forked from github/pelican

Add a way to know what metadata exists.

This allows in a theme to have a look at the "metadata" attribute of a content
to know what are the metadata fields defined by it.
This commit is contained in:
Alexis Metaireau 2012-04-03 11:58:31 +02:00
commit b845db30de

View file

@ -41,6 +41,9 @@ class Page(object):
for key, value in local_metadata.items():
setattr(self, key.lower(), value)
# also keep track of the metadata attributes available
self.metadata = local_metadata
# default author to the one in settings if not defined
if not hasattr(self, 'author'):
if 'AUTHOR' in settings: