lektor-website/content/docs/themes/installing/contents.lr

78 lines
1.8 KiB
Plaintext
Raw Normal View History

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:
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
```
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
```
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.
!!!! Not implemented yet.
2017-10-26 00:22:17 +02:00
You could add the `themes` variable to the `.lektorproject` file and Lektor will
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
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
```
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
!! 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.