import plugins from core and restructure repo
This commit is contained in:
6
global_license/Readme.rst
Normal file
6
global_license/Readme.rst
Normal file
@@ -0,0 +1,6 @@
|
||||
Global license
|
||||
--------------
|
||||
|
||||
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.
|
||||
1
global_license/__init__.py
Normal file
1
global_license/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from .global_license import *
|
||||
18
global_license/global_license.py
Normal file
18
global_license/global_license.py
Normal file
@@ -0,0 +1,18 @@
|
||||
"""
|
||||
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_generate_context.connect(add_license)
|
||||
Reference in New Issue
Block a user