Metadata-Version: 2.1
Name: pelican-minification
Version: 1.0.0
Summary: Minifies HTML, CSS and JS of generated Pelican content.
Home-page: https://github.com/dArignac/pelican-minification
Author: Alexander Herrmann
Author-email: github@torv.rocks
License: UNKNOWN
Keywords: pelican,javascript,css,html,minification
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: End Users/Desktop
Classifier: Natural Language :: English
Classifier: Operating System :: POSIX :: Linux
Classifier: Topic :: Text Processing :: Markup
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: License :: OSI Approved :: MIT License
Description-Content-Type: text/x-rst
Provides-Extra: dev
License-File: LICENSE

pelican-minification
====================

**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:

* `htmlmin`_
* `csscompressor`_
* `jsmin`_
* `BeautifulSoup`_
* `Pelican`_


Install pelican-minification into your Python interpreter using pip:

.. code-block:: shell

    pip install pelican-minification


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

.. code-block:: python

    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):

.. code-block:: python

    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
------------
* `darignac`_ (original code)
* `ysard`_ (refactoring 2022)


.. _htmlmin: https://pypi.python.org/pypi/htmlmin
.. _csscompressor: https://pypi.python.org/pypi/csscompressor
.. _jsmin: https://pypi.org/project/jsmin
.. _BeautifulSoup: https://pypi.org/project/beautifulsoup4
.. _Pelican: https://pypi.python.org/pypi/pelican
.. _darignac: https://github.com/darignac
.. _ysard: https://github.com/ysard

