Skip to content

Commit

Permalink
Add Rust/Cargo req. to README, w/ other fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
justinmayer committed Jul 31, 2023
1 parent 869e697 commit 9a57b6f
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,39 @@ 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`](https://pypi.org/project/minify-html) Python package, which in turn utilizes the Rust-based [minify-html](https://github.com/wilsonzlin/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](https://docs.getpelican.com/en/latest/plugins.html#how-to-use-plugins) documentation.

Usage
-----

By default, all HTML and CSS files will be conpressed, including inline JavaScript and CSS rules in `<script>` and `<style>` tags.
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 pelicanconf.py* (here are the default values):
To configure the behavior of the plugin, add the following variables in your Pelican settings file (values shown here are the default values):

```
```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.
Please note that `INLINE_CSS_MIN` and `INLINE_JS_MIN` require that `HTML_MIN` be enabled.

Contributing
------------
Expand Down

0 comments on commit 9a57b6f

Please sign in to comment.