1
0
Fork 0

Populate GENERATOR in a plugin

pub/python-goto
LEdoian 3 years ago
parent 87f31cbb8b
commit 607f74690e

@ -10,9 +10,6 @@ AUTHOR = "LEdoian"
SITENAME = "LEdoian's Blog"
SITE_DESCRIPTION = "My personal webpage" # NOTE: Theme-specific
# FIXME: Ugly hack, write a plugin instead!
GENERATOR = "Pelican "+pelican.__version__ # NOTE: Theme-specific
SITEURL = 'https://blog.ledoian.cz/'
RELATIVE_URLS = True
@ -27,6 +24,8 @@ JINJA_ENVIRONMENT = {
'keep_trailing_newline': True,
}
PLUGINS = ['plugins.pelicanversion']
TIMEZONE = 'Europe/Prague'
DEFAULT_LANG = 'en'

@ -0,0 +1,13 @@
import pelican
class PelicanVersionGenerator(pelican.generators.Generator):
def generate_context(self):
version = f"Pelican {pelican.__version__}"
self.context['GENERATOR'] = version
def get_generators(_peli):
return PelicanVersionGenerator
def register():
pelican.signals.get_generators.connect(get_generators)
Loading…
Cancel
Save