Ryan H
Ryan H

Reputation: 2953

Jekyll plugin options error when trying to include options

I'm trying to use the "jekyll-minifier" plugin and have got the plugin in my config file, however, I'm having trouble with passing in options:

Attempt 1: Doesn't work

# Plugins to make everything better
plugins:
  - jekyll-sitemap
  - jekyll-minifier
    preserve_php: true                # Default: false
    remove_spaces_inside_tags: true   # Default: true
    remove_multi_spaces: true         # Default: true
    remove_comments: true             # Default: true
    remove_intertag_spaces: true      # Default: false
    remove_quotes: false              # Default: false
    compress_css: false                # Default: true
    compress_javascript: false         # Default: true
    compress_json: false               # Default: true
    simple_doctype: false             # Default: false
    remove_script_attributes: false   # Default: false
    remove_style_attributes: false    # Default: false
    remove_link_attributes: false     # Default: false
    remove_form_attributes: false     # Default: false
    remove_input_attributes: false    # Default: false
    remove_javascript_protocol: false # Default: false
    remove_http_protocol: false       # Default: false
    remove_https_protocol: false      # Default: false
    preserve_line_breaks: false       # Default: false
    simple_boolean_attributes: false  # Default: false
    compress_js_templates: false      # Default: false
    preserve_patterns:                # Default: (empty)
    uglifier_args:                    # Default: (empty)

Where am I going wrong!

Upvotes: 0

Views: 27

Answers (1)

David Jacquel
David Jacquel

Reputation: 52829

You are supposed to have two entries for jekyll minifier in your _config.yml file :

one to enable the plugin :

plugins:
    - jekyll-minifier

and one to configure your plugin :

jekyll-minifier:
  preserve_php: true                # Default: false
  ...

Upvotes: 1

Related Questions