Creating a Theme

Not implemented yet.

You could create a basic empty theme with the following command:

$ lektor dev new-theme

Theme Components:

A theme could provide templates, assets, and models (also flowblocks):

├── assets
├── models
├── templates
└── flowblocks

The theme_settings Variable

A theme_settings section in .lektorproject file could be used to parametrize themes:

name = "Lektor"
github_url = ""

And those settings will be accessed in templates through the config env variable:

{{ config.theme_settings.<variable_name> }}


<a href="{{ config.theme_settings.github_url }}">Github</a>

will output:

<a href="">Github</a>

The theme.ini File

Themes could provide a theme.ini file, that is optional, but it's required if you want to add your theme to the lektor community themes.


name = Demo theme
license = MIT
licenselink =
description = Simple, minimal theme for Lektor
homepage =
tags = simple, minimal, demo
features = blog
lektor_minimum_required_version = 3.1

name = lektor
homepage =

author =
homepage =
repo =

lektor-disqus-comments = 0.2

The [original] section is only required if you are porting an existing theme.

Not implemented yet

The lektor_minimum_required_version is used by Lektor to check the compatibility when installing a theme.

Releasing a Theme

Not implemented yet

You could add a theme to Lektor community theme, open a pull request against lektor themes adding it as a git submodule.

You should also include an images/ folder with a screenshot and a thumbnail:

└──  images
    ├── thumbnail.png
    └── screenshot.png

Themes added to this lektor-themes repository, will automatically be added to the lektor website.