Skip to main content

pelican-htmlmin

A Pelican plugin using htmlmin to remove comments and extra whitespace from your website.

Turning this:

<head>
  <title>  Hello, World!  </title>
</head>
<body>
  <p> How  <em>you</em> doing?  </p>
</body>

Into this:

<head><title>Hello, World!</title><body><p> How <em>you</em> doing? </p></body>

Installing

pelican-htmlmin, is available on pip and takes advantage of Pelican’s namespace system to automatically register installed plugins.

Just install with pip and you’re ready to go:

$ pip install pelican-htmlmin

For a more detailed plugin installation guide, please refer to the Pelican Plugin Documentation.

Options

Being a very small wrapper around htmlmin, there are only a few options that you may need.

HTMLMIN_ENABLED

By Default, if Pelican is in DEBUG mode, pelican-htmlmin will not minify any files, to help with debugging. To override this, set HTMLMIN_ENABLED = True to minify files regardless of the DEBUG flag.

HTMLMIN_ENABLED = logger.getEffectiveLevel() > logging.DEBUG

HTMLMIN_MATCH

Out of the box, pelican-htmlmin looks for files ending with .html or .htm to minify. You can use the HTMLMIN_MATCH to change the regular expression that matches the files you wish to minify.

HTMLMIN_MATCH = r'.html?$'

HTMLMIN_OPTIONS

If you wish to pass arguments directly to htmlmin, use the HTMLMIN_OPTIONS to pass keyword arguments.

HTMLMIN_OPTIONS = {
    'remove_comments': True,
    'remove_all_empty_space': True,
    'remove_optional_attribute_quotes': False
}

For more information on the arguments you can give htmlmin, see their documentation here

Contributing

Please feel free to help. Buying me Beer, emailing issues, or patches via email, are all warmly welcomed, especially beer.

License: MIT

Metadata

Release files for pelican-htmlmin 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pelican-htmlmin 2.0.0
File Size Uploaded Provenance Actions
pelican-htmlmin-2.0.0.tar.gz 3.5 kB Without provenance Details for pelican-htmlmin-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pelican-htmlmin 2.0.0
File Interpreter ABI Platform Actions
pelican_htmlmin-2.0.0-py3-none-any.whl Python 3 none any Details for pelican_htmlmin-2.0.0-py3-none-any.whl

Total release size: 7.1 kB

Release files / pelican-htmlmin-2.0.0.tar.gz

Download URL pelican-htmlmin-2.0.0.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9be51a994bdd6916d2c5d313226761a161628ccd16adffa65cae99cca54b9598
BLAKE2b-256 checksum
How to use checksums
2964030c5a6ff21e1f1639d7666a60b2e36d9b759ad043b8368629074581fd4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

Release files / pelican_htmlmin-2.0.0-py3-none-any.whl

Download URL pelican_htmlmin-2.0.0-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d18fa15d70fee9163dc91f7e12db73c337e1450a076592f37f9a8b895d6023fa
BLAKE2b-256 checksum
How to use checksums
27ef71c4e4baea6c483f53fc5c8ba58509c172c81d26294ce70a51233e626792
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.8

Security for pelican-htmlmin 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page