Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
pelican-htmlmin ###############
A Pelican <https://github.com/getpelican/pelican/>
_ plugin using
htmlmin <https://github.com/mankyd/htmlmin>
_ to remove comments and extra
whitespace from your website.
Turning this:
.. code-block:: html
Hello, World!How you doing?
Into this:
.. code-block:: html
Hello, World!How you doing?
Installing ##########
:code:pelican-htmlmin
, is available on :code:pip
and takes advantage of
Pelican's namespace system to automatically register installed plugins.
Just install with :code:pip
and you're ready to go:
.. code-block::
$ pip install pelican-htmlmin
For a more detailed plugin installation guide, please refer to the
Pelican Plugin Documentation
_.
.. _Pelican Plugin Documentation
: https://docs.getpelican.com/en/latest/plugins.html
Options #######
Being a very small wrapper around :code:htmlmin
, there are only a few options
that you may need.
By Default, if Pelican is in :code:DEBUG
mode, :code:pelican-htmlmin
will
not minify any files, to help with debugging. To override this, set
:code:HTMLMIN_ENABLED = True
to minify files regardless of the
:code:DEBUG
flag.
.. code-block:: python
HTMLMIN_ENABLED = logger.getEffectiveLevel() > logging.DEBUG
Out of the box, :code:pelican-htmlmin
looks for files ending with
:code:.html
or :code:.htm
to minify. You can use the :code:HTMLMIN_MATCH
to change the regular expression that matches the files you wish to minify.
.. code-block:: python
HTMLMIN_MATCH = r'.html?$'
If you wish to pass arguments directly to :code:htmlmin
, use the
:code:HTMLMIN_OPTIONS
to pass keyword arguments.
.. code-block:: python
HTMLMIN_OPTIONS = { 'remove_comments': True, 'remove_all_empty_space': True, 'remove_optional_attribute_quotes': False }
For more information on the arguments you can give :code:htmlmin
, see their
documentation here <https://htmlmin.readthedocs.io/en/latest/reference.html#main-functions>
_
Contributing ############
Please feel free to help. Buying me Beer <https://www.buymeacoffee.com/bryanbrattlof>
, emailing issues, or patches via email <https://bryanbrattlof.com/connect/>
, are all warmly welcomed,
especially beer.
.. image:: https://img.shields.io/badge/license-MIT-green.svg :alt: License: MIT
FAQs
Minifies HTML files generated by Pelican
We found that pelican-htmlmin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.