Skip to main content

Pelican plugin to minify HTML, CSS and Javascript

Project description

Minify: A Plugin for Pelican

Build Status PyPI Version Downloads License

This Pelican plugin can compress HTML & CSS files as well as inline CSS and JavaScript in HTML files.

Requirements

Because this plugin depends on the minify-html Python package, which in turn utilizes the Rust-based minify-html project, you must have Cargo (the Rust package manager) installed and available on your PATH. Rust and Cargo can be installed on Mac systems via Homebrew:

brew install rust

Alternatively, Rust and Cargo can be installed via your particular system’s package manager or via: https://rustup.rs/

Installation

This plugin can be installed via:

python -m pip install pelican-minify

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 minify to your existing PLUGINS list. For more information, please see the How to Use Plugins documentation.

Usage

By default, all HTML and CSS files will be compressed, including inline JavaScript and CSS rules in <script> and <style> tags.

To configure the behavior of the plugin, add the following variables in your Pelican settings file (values shown here are the default values):

CSS_MIN = True
JS_MIN = True
HTML_MIN = True
INLINE_CSS_MIN = True
INLINE_JS_MIN = True

Please note that INLINE_CSS_MIN and INLINE_JS_MIN require that HTML_MIN be enabled.

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 MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pelican_minify-2.0.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pelican_minify-2.0.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file pelican_minify-2.0.1.tar.gz.

File metadata

  • Download URL: pelican_minify-2.0.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pelican_minify-2.0.1.tar.gz
Algorithm Hash digest
SHA256 dd8f07bb264cfb0b784f1f88ab22a990d14f6d21e6d504017eb53f27e2cfd1b1
MD5 f17ab9f09af4d07b37403a4dc4b485f6
BLAKE2b-256 0728fb71a16c86aecbc76936327fd206355d4a4657fc9e6d3dbec92756def6bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for pelican_minify-2.0.1.tar.gz:

Publisher: main.yml on pelican-plugins/minify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pelican_minify-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: pelican_minify-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pelican_minify-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 87bacb03f8a75a03e40c93d6cea986271841a4f5f1214d2f35ce741019327bb0
MD5 17c7ccda065cd6089b40e90214c94cb5
BLAKE2b-256 433d78a0e03be59c04478d0720173a9083e525574c04eb148661cce9a490b883

See more details on using hashes here.

Provenance

The following attestation bundles were made for pelican_minify-2.0.1-py3-none-any.whl:

Publisher: main.yml on pelican-plugins/minify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page