Theme Configuration: A Plugin for Pelican
This package provides a plugin for the Pelican static website generator and
adds support for themes to adjust Pelican's configuration using the
themeconf.py file located in the root directory of the theme.
Installation
This plugin can be installed via:
python -m pip install pelican-theme-config
Usage
Add theme_config to the list of plugins in the pelicanconf.py file, e.g.
PLUGINS = [ "theme_config" ]
From that point on, Pelican will try to load the themeconf.py from theme's
directory.
Overview
This plugin allows theme authors to create more self-contained themes since everything that a theme requires can be configured within the theme itself:
- themes can be shipped with their own plugins
- themes can provide their static content (e.g. a theme that implements
Google's PWA can provide
manifest.jsonthat should be put into the root of the website) - basically, authors could do almost anything :) since with this plugin theme gets control
The code is hooked up early in Pelican's start-up sequence leveraging the "initialized" Pelican event, so almost every configuration option can be safely redefined and would take effect.
However, since the plugin hooks up after the sanity checks on the provided configuration were done by Pelican this gives some opportunities and risks. Basically, theme authors should be careful to adhere to Pelican's conventions on the configuration directives, otherwise they may confuse their users.
This plugin protects the following configuration options from being modified by the theme:
- BIND
- CACHE_PATH
- PATH
- PELICAN_CLASS
- OUTPUT_PATH
- SITEURL
- THEME
- THEME_CONFIG
- THEME_CONFIG_PROTECTED
- PORT
This list can be configured by the end user in pelicanconf.py if they want
to restrict it even further or make it more relaxed. The goal is to give the
user the ability to define the expected behaviour for their configuration.
The plugin introduces the following configuration options one can specify in the primary Pelican configuration file:
# The name of the file to lookup in theme's directory
THEME_CONFIG = "themeconf.py"
# The list of configuration options to be protected from modification
THEME_CONFIG_PROTECTED = ["PATH","OUTPUT_PATH"]
Contributing
Contributions are welcome and much appreciated. Every little bit helps. You can contribute by improving the documentation, adding missing features, and fixing bugs. You can also help out by reviewing and commenting on existing issues.
To start contributing to this plugin, review the Contributing to Pelican documentation, beginning with the Contributing Code section.
Credits
Authored by Dmitry Khlebnikov.
Metadata
Release files for pelican-theme-config 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pelican_theme_config-2.0.2.tar.gz | 5.8 kB | Without provenance | Details for pelican_theme_config-2.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pelican_theme_config-2.0.2-py3-none-any.whl | Python 3 | none | any | Details for pelican_theme_config-2.0.2-py3-none-any.whl |
Total release size: 11.6 kB
Release files / pelican_theme_config-2.0.2.tar.gz
| Download URL | pelican_theme_config-2.0.2.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69519b21a7afd38df85daf2ce9083da362a91c27d36ba8b5f720186f4378182f
|
|
BLAKE2b-256 checksum How to use checksums |
3993c6663e00208173883f8e3a36a7011c3c00ea4badb35cc283c434bd8a3e5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.9.16 Linux/5.15.0-1033-azure
|
Release files / pelican_theme_config-2.0.2-py3-none-any.whl
| Download URL | pelican_theme_config-2.0.2-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
65e18393c6fc474d0b1aef8922dd6fcb4850a66a33d1277bc92fa83f66cbc02f
|
|
BLAKE2b-256 checksum How to use checksums |
e863f2f34ab471f427679ee4bddc817c3ffb66a1e29d01ec1d1b5db609ce2ee6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.9.16 Linux/5.15.0-1033-azure
|
Security for pelican-theme-config 2.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.