forked from github/pelican
Remove the dependency to pkgutil for the plugins
This commit is contained in:
parent
7184484488
commit
c5a63c953a
9 changed files with 84 additions and 89 deletions
23
pelican/plugins/global_license.py
Normal file
23
pelican/plugins/global_license.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
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, metadata):
|
||||
if 'license' not in metadata.keys()\
|
||||
and 'LICENSE' in generator.settings.keys():
|
||||
metadata['license'] = generator.settings['LICENSE']
|
||||
|
||||
|
||||
signal('pelican_article_generate_context').connect(add_license)
|
||||
Loading…
Add table
Add a link
Reference in a new issue