pelican-theme-config


Namepelican-theme-config JSON
Version 2.0.1 PyPI version JSON
download
home_pagehttps://github.com/pelican-plugins/theme-config
SummaryPelican plugin to add footnotes to articles and pages
upload_time2023-01-26 09:53:54
maintainer
docs_urlNone
author(GalaxyMaster)
requires_python>=3.7,<4.0
licenseAGPL-3.0
keywords theme pelican plugin
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Theme Configuration: A Plugin for Pelican
==========================================

[![Build Status](https://img.shields.io/github/actions/workflow/status/pelican-plugins/theme-config/main.yml?branch=main)](https://github.com/pelican-plugins/theme-config/actions)
[![PyPI Version](https://img.shields.io/pypi/v/pelican-theme-config)](https://pypi.org/project/pelican-theme-config/)

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.json` that 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](https://dmitry.khlebnikov.net/).

[existing issues]: https://github.com/pelican-plugins/theme-config/issues
[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pelican-plugins/theme-config",
    "name": "pelican-theme-config",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "theme,pelican,plugin",
    "author": "(GalaxyMaster)",
    "author_email": "galaxy4public+pypi@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f5/f1/876f09c38ac4bf41590ee02dc25430dd64aa4501859da203cc35dbc74e50/pelican_theme_config-2.0.1.tar.gz",
    "platform": null,
    "description": "Theme Configuration: A Plugin for Pelican\n==========================================\n\n[![Build Status](https://img.shields.io/github/actions/workflow/status/pelican-plugins/theme-config/main.yml?branch=main)](https://github.com/pelican-plugins/theme-config/actions)\n[![PyPI Version](https://img.shields.io/pypi/v/pelican-theme-config)](https://pypi.org/project/pelican-theme-config/)\n\nThis package provides a plugin for the Pelican static website generator and\nadds support for themes to adjust Pelican's configuration using the\n`themeconf.py` file located in the root directory of the theme.\n\nInstallation\n------------\n\nThis plugin can be installed via:\n\n    python -m pip install pelican-theme-config\n\nUsage\n-----\n\nAdd `theme_config` to the list of plugins in the `pelicanconf.py` file, e.g.\n\n    PLUGINS = [ \"theme_config\" ]\n\nFrom that point on, Pelican will try to load the `themeconf.py` from theme's\ndirectory.\n\nOverview\n--------\n\nThis plugin allows theme authors to create more self-contained themes since\neverything that a theme requires can be configured within the theme itself:\n\n  * themes can be shipped with their own plugins\n  * themes can provide their static content (e.g. a theme that implements\n    Google's PWA can provide `manifest.json` that should be put into the\n    root of the website)\n  * basically, authors could do almost anything :) since with this plugin\n    theme gets control\n\nThe code is hooked up early in Pelican's start-up sequence leveraging the\n\"initialized\" Pelican event, so almost every configuration option can be\nsafely redefined and would take effect.\n\nHowever, since the plugin hooks up after the sanity checks on the provided\nconfiguration were done by Pelican this gives some opportunities and risks.\nBasically, theme authors should be careful to adhere to Pelican's conventions\non the configuration directives, otherwise they may confuse their users.\n\nThis plugin protects the following configuration options from being modified\nby the theme:\n\n  - BIND\n  - CACHE_PATH\n  - PATH\n  - PELICAN_CLASS\n  - OUTPUT_PATH\n  - SITEURL\n  - THEME\n  - THEME_CONFIG\n  - THEME_CONFIG_PROTECTED\n  - PORT\n\nThis list can be configured by the end user in `pelicanconf.py` if they want\nto restrict it even further or make it more relaxed.  The goal is to give the\nuser the ability to define the expected behaviour for their configuration.\n\nThe plugin introduces the following configuration options one can specify in\nthe primary Pelican configuration file:\n\n    # The name of the file to lookup in theme's directory\n    THEME_CONFIG = \"themeconf.py\"\n\n    # The list of configuration options to be protected from modification\n    THEME_CONFIG_PROTECTED = [\"PATH\",\"OUTPUT_PATH\"]\n\nContributing\n------------\n\nContributions are welcome and much appreciated. Every little bit helps. You can\ncontribute by improving the documentation, adding missing features, and fixing\nbugs. You can also help out by reviewing and commenting on [existing issues][].\n\nTo start contributing to this plugin, review the [Contributing to Pelican][]\ndocumentation, beginning with the **Contributing Code** section.\n\nCredits\n-------\n\nAuthored by [Dmitry Khlebnikov](https://dmitry.khlebnikov.net/).\n\n[existing issues]: https://github.com/pelican-plugins/theme-config/issues\n[Contributing to Pelican]: https://docs.getpelican.com/en/latest/contribute.html\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0",
    "summary": "Pelican plugin to add footnotes to articles and pages",
    "version": "2.0.1",
    "split_keywords": [
        "theme",
        "pelican",
        "plugin"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e80bf772b07b7cf52a09d3a780ce26291b9d515adcf6aeaf4b567ba0b71bf969",
                "md5": "eebf8000ef89d3bf40d373225c825927",
                "sha256": "c39db6fab213ba5a7d94f41d706e1d92817c5a4ab8230640789c65af9d3d5be2"
            },
            "downloads": -1,
            "filename": "pelican_theme_config-2.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eebf8000ef89d3bf40d373225c825927",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 5767,
            "upload_time": "2023-01-26T09:53:53",
            "upload_time_iso_8601": "2023-01-26T09:53:53.077014Z",
            "url": "https://files.pythonhosted.org/packages/e8/0b/f772b07b7cf52a09d3a780ce26291b9d515adcf6aeaf4b567ba0b71bf969/pelican_theme_config-2.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f5f1876f09c38ac4bf41590ee02dc25430dd64aa4501859da203cc35dbc74e50",
                "md5": "a313426029dfc84850be6913151f7f65",
                "sha256": "e8cad827880700b0efe8d70a629c5601af0a3cc6e49f15ca58663dc977c4c94f"
            },
            "downloads": -1,
            "filename": "pelican_theme_config-2.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a313426029dfc84850be6913151f7f65",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 5869,
            "upload_time": "2023-01-26T09:53:54",
            "upload_time_iso_8601": "2023-01-26T09:53:54.711968Z",
            "url": "https://files.pythonhosted.org/packages/f5/f1/876f09c38ac4bf41590ee02dc25430dd64aa4501859da203cc35dbc74e50/pelican_theme_config-2.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-26 09:53:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "pelican-plugins",
    "github_project": "theme-config",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pelican-theme-config"
}
        
Elapsed time: 0.03227s