mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add a DEFAULT_METADATA setting.
It is now possible to have soem default metadata defined in the settings. Fixes #98
This commit is contained in:
parent
e09444fa89
commit
56effc24cb
5 changed files with 11 additions and 1 deletions
|
|
@ -16,7 +16,10 @@ class Page(object):
|
|||
self.translations = []
|
||||
|
||||
self.status = "published" # default value
|
||||
for key, value in metadatas.items():
|
||||
|
||||
local_metadata = dict(settings['DEFAULT_METADATA'])
|
||||
local_metadata.update(metadatas)
|
||||
for key, value in local_metadata.items():
|
||||
setattr(self, key.lower(), value)
|
||||
|
||||
if not hasattr(self, 'author'):
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ _DEFAULT_CONFIG = {'PATH': None,
|
|||
'WITH_PAGINATION': False,
|
||||
'DEFAULT_PAGINATION': 5,
|
||||
'DEFAULT_ORPHANS': 0,
|
||||
'DEFAULT_METADATA': (),
|
||||
}
|
||||
|
||||
def read_settings(filename):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue