mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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:
parent
f492f2d14d
commit
b845db30de
1 changed files with 3 additions and 0 deletions
|
|
@ -41,6 +41,9 @@ class Page(object):
|
||||||
for key, value in local_metadata.items():
|
for key, value in local_metadata.items():
|
||||||
setattr(self, key.lower(), value)
|
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
|
# default author to the one in settings if not defined
|
||||||
if not hasattr(self, 'author'):
|
if not hasattr(self, 'author'):
|
||||||
if 'AUTHOR' in settings:
|
if 'AUTHOR' in settings:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue