Plugins

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.

Installing Published Plugins

Lektor can find and install plugins that have been published to PyPI for you. For completely automated plugin management just open your project file in a text editor and edit or extend the [packages] section. Just add a line for each plugin in the form name = version:

[packages]
lektor-cool-plugin = 1.0
lektor-other-plugin = 1.2

It's also possible to use the plugins add command lektor plugin add NAME to automatically add the latest version of a plugin to the project file.

To upgrade a plugin just increase the version number to the release you want and Lektor will do the rest.

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.

Comments