1
0
Fork 0
forked from github/pelican
pelican-theme/pelican/plugins/global_license.py
2011-06-18 01:03:53 +02:00

23 lines
530 B
Python

from pelican import signals
"""
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, metadata):
if 'license' not in metadata.keys()\
and 'LICENSE' in generator.settings.keys():
metadata['license'] = generator.settings['LICENSE']
def register():
signals.article_generate_context.connect(add_license)