2015-12-19 14:52:17 +01:00
|
|
|
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
|
2016-02-11 01:13:37 +01:00
|
|
|
on the environment but needs to be explicitly loaded. This happens with
|
2015-12-19 14:52:17 +01:00
|
|
|
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()
|
|
|
|
```
|