27 lines
669 B
Plaintext
27 lines
669 B
Plaintext
|
title: load_config
|
||
|
---
|
||
|
type: method
|
||
|
---
|
||
|
summary: Loads the current config from the project file.
|
||
|
---
|
||
|
body:
|
||
|
|
||
|
Because the environment is reused between builds, the config is not cached
|
||
|
on the environment but needs to be expicitly loaded. This happens with
|
||
|
the help of the `load_config` method. It returns a config object that
|
||
|
gives access to the settings in the project file.
|
||
|
|
||
|
These settings are work in progress and if you want to know how to use
|
||
|
the config file and what to do with it, you have to consult the source
|
||
|
code.
|
||
|
|
||
|
## Example
|
||
|
|
||
|
```python
|
||
|
from lektor.project import Project
|
||
|
|
||
|
project = Project.discover()
|
||
|
env = project.make_env()
|
||
|
config = env.load_config()
|
||
|
```
|