2018-01-11 23:53:29 +01:00
|
|
|
title: Installing a Theme
|
2017-10-26 00:22:17 +02:00
|
|
|
---
|
|
|
|
sort_key: 10
|
|
|
|
---
|
|
|
|
summary: Explains how to install Lektor themes.
|
|
|
|
---
|
|
|
|
body:
|
|
|
|
|
2018-07-16 21:38:58 +02:00
|
|
|
For installing a theme you just need to copy it to the `themes/` folder. Create the `themes/` folder if it does not already exist.
|
2017-10-26 00:22:17 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
project
|
|
|
|
├── assets
|
|
|
|
├── models
|
|
|
|
├── content
|
|
|
|
...
|
|
|
|
└── themes
|
|
|
|
└── lektor-theme-nix
|
|
|
|
```
|
|
|
|
|
2018-01-11 23:50:06 +01:00
|
|
|
Themes are normally distributed by public Git repositories, so you could install a theme by
|
2017-10-26 00:22:17 +02:00
|
|
|
cloning the repo:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cd themes
|
|
|
|
git clone URL_TO_THEME_REPO
|
|
|
|
```
|
|
|
|
|
|
|
|
For example, for installing `lektor-theme-nix`:
|
|
|
|
```bash
|
|
|
|
cd themes
|
|
|
|
git clone https://github.com/rlaverde/lektor-theme-nix.git
|
|
|
|
```
|
|
|
|
|
2018-01-11 23:50:06 +01:00
|
|
|
If you download several themes, setting `themes` variable will allow you to only load
|
2017-10-26 00:22:17 +02:00
|
|
|
a particular theme.
|
|
|
|
|
2018-01-11 23:50:06 +01:00
|
|
|
!!!! Not implemented yet.
|
2017-10-26 00:22:17 +02:00
|
|
|
|
2018-01-11 23:50:06 +01:00
|
|
|
You could add the `themes` variable to the `.lektorproject` file and Lektor will
|
2022-02-27 22:49:48 +01:00
|
|
|
search in the
|
|
|
|
<!-- FIXME: use this link when theme showcase exists [community themes](/themes/) -->
|
|
|
|
[community themes :ext](https://github.com/lektor/lektor-themes)
|
|
|
|
and automatically install it.
|
2017-10-26 00:22:17 +02:00
|
|
|
|
|
|
|
```ini
|
|
|
|
[project]
|
2018-06-20 08:23:36 +02:00
|
|
|
themes = lektor-theme-nix
|
2017-10-26 00:22:17 +02:00
|
|
|
```
|
|
|
|
|
2018-01-12 00:28:04 +01:00
|
|
|
## Installing Multiple Themes
|
2017-10-26 00:22:17 +02:00
|
|
|
|
2018-01-11 23:50:06 +01:00
|
|
|
Lektor also supports installing several themes. Copy them to the `themes/`
|
2017-10-26 00:22:17 +02:00
|
|
|
folder, and set the `themes` variable to indicate the precedence (optional).
|
|
|
|
|
|
|
|
```
|
|
|
|
project
|
|
|
|
├── assets
|
|
|
|
├── models
|
|
|
|
├── content
|
|
|
|
...
|
|
|
|
└── themes
|
|
|
|
├── lektor-theme-other-theme/
|
|
|
|
└── lektor-theme-nix/
|
|
|
|
```
|
|
|
|
|
|
|
|
```ini
|
|
|
|
[project]
|
2018-06-20 08:23:36 +02:00
|
|
|
themes = lektor-theme-nix, lektor-theme-other-theme
|
2017-10-26 00:22:17 +02:00
|
|
|
```
|
|
|
|
|
2018-01-11 23:50:06 +01:00
|
|
|
This will make `lektor-theme-nix`, because it's listed first, have a higher precedence.
|
|
|
|
Files present in multiple themes will be loaded from right to left, so that the first (left-most)
|
|
|
|
theme is preferred over the theme(s) to its right.
|
2017-10-26 00:22:17 +02:00
|
|
|
|
2018-01-11 23:50:06 +01:00
|
|
|
!! If you don't set the `themes` variable, all themes will be loaded, but the order
|
2017-10-26 00:22:17 +02:00
|
|
|
isn't preserved.
|