aboutsummaryrefslogtreecommitdiffstats
path: root/README.rst
blob: 31e043cefe29a76fd6d437079ba61e27b8aace21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Pelican Themes
##############

This repository contains themes for Pelican. Feel free to clone, add your own
theme, and submit a pull request. It's community-managed!

A live version can be seen at http://www.pelicanthemes.com.

Using Themes
############

These instructions assume you have already read all the `Pelican documentation`_,
have a working site, and would now like to apply a non-default theme.

.. _Pelican documentation: http://docs.getpelican.com/

First, choose a location to hold your themes. For this example, we'll use the
directory ``~/pelican-themes``, but yours could be different. Clone the
``pelican-themes`` repository to that location on your local machine:

.. code-block:: sh

	git clone --recursive https://github.com/getpelican/pelican-themes ~/pelican-themes

Now you should have your ``pelican-themes`` repository stored at
``~/pelican-themes/``.

To use one of the themes, edit your Pelican settings file to include this line:

.. code-block:: python

	THEME = "/home/user/pelican-themes/theme-name"

So, for instance, to use the ``mnmlist`` theme, you would edit your settings
file to include:

.. code-block:: python

	THEME = "/home/user/pelican-themes/mnmlist"

Save the changes to your settings file and then regenerate your site by using
the Makefile you should already have set up using ``pelican-quickstart``:

.. code-block:: sh

	make html

Themes can also be specified directly via the ``-t ~/pelican-themes/theme-name``
parameter to the ``pelican`` command. If you want to edit your theme, make sure
that any edits you make are made to the copy stored in
``~/pelican-themes/theme-name``. Any changes made to
files stored in your site's ``output`` directory will be deleted the next
time you generate your site.

Generating Theme Previews
#########################

Generating theme previews happens automatically via a GitHub Actions workflow,
after which those previews are published to https://pelicanthemes.com.
If you want to generate previews locally on your workstation, clone the Pelican
repository (for example, to `~/projects/pelican/`), clone this repository
somewhere, change to the root directory of that clone, and follow these steps:

.. code-block:: sh

	python -m pip install pelican[markdown] shot-scraper
        mkdir _pelican
        cp -r ~/projects/pelican/samples _pelican/
        python build-theme-previews.py