This function returns the currently active Build Context
None if no context is active. This is the main method to access the
context. Generally the context is available if a build is active and
if not. This means that if plugins only call that method in places where
they know a build is access it's not necessary to check if the context is
For more information: Context.
from lektor.context import get_ctx ctx = get_ctx()