Skip to main content

Minifies HTML, CSS and JS of generated Pelican content.

Project description

Note that the plugin name changed to `pelican.plugins.minification` with version 1.0.0!

Content minification for the Pelican site generator. This plugin can compress HTML & CSS files as well as inline CSS and JavaScript in HTML files.

Installation and Usage

pelican-minification depends on the following packages that will be installed automatically, see below:

Install pelican-minification into your Python interpreter using pip:

pip install pelican-minification

Then add the plugin to the PLUGINS setting within your pelicanconf.py:

PLUGINS = [
    ...
    'pelican.plugins.minification',
]

Upon calling the pelican command now, all HTML and CSS files are compressed automatically; including inline JavaScript and CSS rules in <script> and <style> tags.

To configure the behavior of the plugin, add the following variables in your pelicanconf.py (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 HTML_MIN be enabled.

Contributors

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-minification-1.0.0.tar.gz (5.4 kB view hashes)

Uploaded Source

Built Distribution

pelican_minification-1.0.0-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

Supported by

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