Pelican plugin to minify HTML, CSS and Javascript
Project description
Minify: A Plugin for Pelican
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
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
Built Distribution
File details
Details for the file pelican_minify-2.0.0.tar.gz
.
File metadata
- Download URL: pelican_minify-2.0.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.8.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50a1e33a5f2acb8ce8a8c2e4223327745d7d61fe90f6c4a6dfe726bea9f1d503 |
|
MD5 | f23dda20b71c162e5519e55ab203e40a |
|
BLAKE2b-256 | c6f1451947740435feadb51e957c30cf4d4fa0c543571c23a9203f6406b99529 |
File details
Details for the file pelican_minify-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: pelican_minify-2.0.0-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.8.1 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49359d91f18c289dced9b47ebea828c12ad53154e80f880b186056b13410d392 |
|
MD5 | a393fd5b191864bd67d217183177dfed |
|
BLAKE2b-256 | 58cef16ad38ec4467de4dbf80c225e0f9afc3cf09216b33e65bee524d554cac6 |