Skip to main content

Featured Image: A Plugin for Pelican

Build Status PyPI Version Downloads License

This Pelican plugin extracts an image from the summary or content of an article or page if not already specified in content metadata.

Installation

This plugin can be installed via:

python -m pip install pelican-featured-image

As long as you have not explicitly added a PLUGINS setting to your Pelican settings file, then the newly-installed plugin should be automatically detected and enabled. Otherwise, you must add featured_image to your existing PLUGINS list. For more information, please see the How to Use Plugins documentation.

Usage

To override the default behavior of selecting the first image in the article's summary or content, set the image property the article's metadata to the URL of the image to display, e.g:

Title: My super title
Date: 2010-12-03 10:20
Category: Python
Tags: pelican, publishing
Slug: my-super-post
Author: Alexis Metaireau
Summary: Short version for index and feeds
Image: /images/my-super-image.png

Article content...

Page

To include a representative image in a page add the following to the template:

{% if page.featured_image %}
    <img src="{{ page.featured_image }}">
{% endif %}

Article

To include a representative image in an article add the following to the template:

{% if article.featured_image %}
    <img src="{{ article.featured_image }}">
{% endif %}

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.

License

This project is licensed under the AGPL-3.0 license.

Metadata

Release files for pelican-featured-image 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pelican-featured-image 1.1.0
File Size Uploaded Provenance Actions
pelican_featured_image-1.1.0.tar.gz 4.6 kB With provenance Details for pelican_featured_image-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pelican-featured-image 1.1.0
File Interpreter ABI Platform Actions
pelican_featured_image-1.1.0-py3-none-any.whl Python 3 none any Details for pelican_featured_image-1.1.0-py3-none-any.whl

Total release size: 9.5 kB

Security for pelican-featured-image 1.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

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.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page