Files
pelican-plugins/global_license/global_license.py
Talha Mansoor d3495d0249 Update article_generate_context to article_generator_context
getpelican/pelican@f2d6f77462 changed
`article_generate_context` to `article_generator_context`. This commit
updates the plugin to reflect the change.
2013-08-11 02:14:54 +05:00

19 lines
562 B
Python

"""
License plugin for Pelican
==========================
This plugin allows you to define a LICENSE setting and adds the contents of that
license variable to the article's context, making that variable available to use
from within your theme's templates.
"""
from pelican import signals
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_generator_context.connect(add_license)