source

The context is created for each target artifact. As most artifacts are created from Source Objects, it's typically possible to refer back to it. Note that there are situations in which artifacts are created but no source is available. In this case the value will be None.

Example

from lektor.context import get_ctx

ctx = get_ctx()
print ctx.source.source_filename

Comments