fix on_setup_env callback function naming (#342)

Fix typos: on_env_setup -> on_setup_env
Thank you, @relikd
This commit is contained in:
relikd 2022-03-20 00:37:08 +01:00 committed by GitHub
parent 51002aee91
commit f5327b786d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@ from lektor.context import get_ctx
class MyPlugin(Plugin): class MyPlugin(Plugin):
def on_env_setup(self, **extra): def on_setup_env(self, **extra):
color = self.get_config().get('color') color = self.get_config().get('color')
def get_css(artifact_name='/static/demo.css'): def get_css(artifact_name='/static/demo.css'):
ctx = get_ctx() ctx = get_ctx()

View File

@ -19,7 +19,7 @@ from lektor.pluginsystem import Plugin
class MyPlugin(Plugin): class MyPlugin(Plugin):
def on_env_setup(self, **extra): def on_setup_env(self, **extra):
self.emit('setup', foo=42) self.emit('setup', foo=42)
``` ```

View File

@ -21,7 +21,7 @@ from lektor.pluginsystem import Plugin
class MyPlugin(Plugin): class MyPlugin(Plugin):
def on_env_setup(self, **extra): def on_setup_env(self, **extra):
color = self.get_config().get('color') color = self.get_config().get('color')
self.env.jinja_env.globals['my_color'] = color self.env.jinja_env.globals['my_color'] = color
``` ```