Metadata-Version: 2.4
Name: pelican-ogimages
Version: 0.1.1
Summary: Pelican plugin to generate OpenGraph images
License: AGPL-3.0
License-File: LICENSE.md
Keywords: pelican,plugin
Author: Spirkop
Author-email: contact@spirkop.com
Requires-Python: >=3.11
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Framework :: Pelican
Classifier: Framework :: Pelican :: Plugins
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Dist: pelican (>=4.12.0,<5.0.0)
Requires-Dist: pillow (>=12.2.0,<13.0.0)
Project-URL: Issue Tracker, https://codeberg.org/spirkop/pelican-ogimages/issues
Project-URL: Repository, https://codeberg.org/spirkop/pelican-ogimages
Description-Content-Type: text/markdown

# Generate OpenGraph images for Pelican

[![PyPI Version](https://img.shields.io/pypi/v/pelican-ogimages)](https://pypi.org/project/pelican-ogimages/)
[![Downloads](https://img.shields.io/pypi/dm/pelican-ogimages)](https://pypi.org/project/pelican-ogimages/)
![License](https://img.shields.io/pypi/l/pelican-ogimages?color=blue)

This plugin generate OpenGraph images for each page of your Pelican website. It can be used with the [SEO plugin](https://github.com/pelican-plugins/seo) for the OpenGraph meta tags generation.

## Installation

This plugin can be installed via:

```
pip install pelican-ogimages
```

If not done automatically, add `pelican.plugins.ogimages` to your existing `PLUGINS` list.

Pay attention it must before [SEO plugin](https://github.com/pelican-plugins/seo) in the list.

## Usage

Once installed, the plugin generate a simple image for all the pages and articles. You can override some configuration in your Pelican settings:

```
OGIMAGES_BACKGROUND_IMAGE = None
OGIMAGES_BACKGROUND_COLOR = "#F5F4EF"

OGIMAGES_SITENAME = True
OGIMAGES_SITENAME_COLOR = "#C74350"
OGIMAGES_SITENAME_POSITION = (100, 100)

OGIMAGES_TITLE_COLOR = "#C74350"
OGIMAGES_TITLE_POSITION = (100, 300)

OGIMAGES_SIZE = (1200, 600)
```

### Advanced customization

For advanced customization, you can override the generation function and set it to `OGIMAGES_GENERATOR`.

Exemple in the `pelicanconf.py`:

```python
from PIL import Image, ImageDraw

def generate_og_image(output_path, title, content):
    img = Image.open("og_image_template.png")
    d = ImageDraw.Draw(img)
    d.text((100, 200), title, fill="#5d1c6a", anchor="ls", font_size=60)
    img.save(output_path, "PNG", optimize=True)

OGIMAGES_GENERATOR = generate_og_image
```

## 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](https://codeberg.org/spirkop/pelican-ogimages/issues).

### AI Policy

This project does not allow contributions generated or assisted by Large Languages Models (LLM) or chatbots. This concerns all parts of the project, including, but not limited to, code, documentation, issues and artworks.

## License

This project is licensed under the AGPL-3.0 license.

## Credits

The project is carried out by the [SPIRKOP](https://www.spirkop.com) cooperative 🇪🇺.

