2011-04-26 20:02:05 +02:00
|
|
|
from blinker import signal
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
License plugin for Pelican
|
|
|
|
|
==========================
|
|
|
|
|
|
|
|
|
|
Simply add license variable in article's context, which contain
|
|
|
|
|
the license text.
|
|
|
|
|
|
|
|
|
|
Settings:
|
|
|
|
|
---------
|
|
|
|
|
|
|
|
|
|
Add LICENSE to your settings file to define default license.
|
|
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
def add_license(generator, metadatas):
|
|
|
|
|
if 'license' not in metadatas.keys()\
|
2011-04-26 20:04:44 +02:00
|
|
|
and 'LICENSE' in generator.settings.keys():
|
|
|
|
|
metadatas['license'] = generator.settings['LICENSE']
|
2011-04-26 20:02:05 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
signal('pelican_article_generate_context').connect(add_license)
|