2015-12-19 14:52:17 +01:00
|
|
|
title: Plugins
|
|
|
|
---
|
|
|
|
sort_key: 120
|
|
|
|
---
|
|
|
|
summary: Explains how to use plugins and how to develop them.
|
|
|
|
---
|
|
|
|
body:
|
|
|
|
|
|
|
|
Lektor can be extended through the use of plugins. This is something that
|
|
|
|
can be done on a per-project basis. This gives a quick overview of how
|
|
|
|
to use plugins and how to build your own.
|
|
|
|
|
2018-05-05 08:34:17 +02:00
|
|
|
## Installing Published Plugins
|
2015-12-19 14:52:17 +01:00
|
|
|
|
2018-05-05 08:34:17 +02:00
|
|
|
Lektor can find and install plugins that have been published to [PyPI :ext](https://pypi.org/) fo you.
|
2016-02-11 01:13:37 +01:00
|
|
|
For completely automated plugin management just open your project file in a
|
2015-12-19 14:52:17 +01:00
|
|
|
text editor and edit or extend the `[packages]` section. Just add a line
|
|
|
|
for each plugin in the form `name = version`:
|
|
|
|
|
|
|
|
```ini
|
|
|
|
[packages]
|
|
|
|
lektor-cool-plugin = 1.0
|
|
|
|
lektor-other-plugin = 1.2
|
|
|
|
```
|
|
|
|
|
|
|
|
It's also possible to use the [plugins add :ref](../cli/plugins/add/) command
|
2018-05-05 08:34:17 +02:00
|
|
|
`lektor plugin add NAME` to automatically add the latest version of a plugin
|
|
|
|
to the project file.
|
2015-12-19 14:52:17 +01:00
|
|
|
|
|
|
|
To upgrade a plugin just increase the version number to the release you want
|
|
|
|
and Lektor will do the rest.
|
2018-05-05 08:34:17 +02:00
|
|
|
|
|
|
|
## Loading Plugins
|
|
|
|
|
|
|
|
Plugins can be added to a Lektor project in two different ways:
|
|
|
|
|
|
|
|
1. Plugins can be added to the `[packages]` section of the project. In that
|
|
|
|
case Lektor will automatically download and enable the plugin next time
|
|
|
|
you build the project or run the server. This can be accomplished for you
|
|
|
|
with the automatic install above, or it can be done manually.
|
|
|
|
2. Plugins can be added to the `packages/` folder in your project. Each
|
|
|
|
plugin has to go into a separate folder. This method is especially useful
|
|
|
|
for project specific plugins or for plugin development.
|