9 | | {{ post.title }} | 10 |
gem install jekyll-minifier
16 |
17 | Then add this to your \_config.yml:
18 |
19 | plugins:
20 | - jekyll-minifier
21 |
22 |
23 | Optionally, you can also add exclusions using:
24 |
25 | jekyll-minifier:
26 | exclude: 'atom.xml' # Exclude files from processing - file name, glob pattern or array of file names and glob patterns
27 |
28 |
29 | and toggle features and settings using:
30 |
31 | jekyll-minifier:
32 | preserve_php: true # Default: false
33 | remove_spaces_inside_tags: true # Default: true
34 | remove_multi_spaces: true # Default: true
35 | remove_comments: true # Default: true
36 | remove_intertag_spaces: true # Default: false
37 | remove_quotes: false # Default: false
38 | compress_css: true # Default: true
39 | compress_javascript: true # Default: true
40 | compress_json: true # Default: true
41 | simple_doctype: false # Default: false
42 | remove_script_attributes: false # Default: false
43 | remove_style_attributes: false # Default: false
44 | remove_link_attributes: false # Default: false
45 | remove_form_attributes: false # Default: false
46 | remove_input_attributes: false # Default: false
47 | remove_javascript_protocol: false # Default: false
48 | remove_http_protocol: false # Default: false
49 | remove_https_protocol: false # Default: false
50 | preserve_line_breaks: false # Default: false
51 | simple_boolean_attributes: false # Default: false
52 | compress_js_templates: false # Default: false
53 | preserve_patterns: # Default: (empty)
54 | uglifier_args: # Default: (empty)
55 |
56 |
57 | js_args can be found in the the uglifier documentation at listed below
58 |
59 | Note: es6 has been implemented as experimental only via the upstream uglifier package.
60 | See https://github.com/lautis/uglifier for more information.
61 |
62 | To enable es6 syntax use:
63 |
64 |
65 | jekyll-minifier:
66 | uglifier_args:
67 | harmony: true
68 |
69 |
70 |
71 |
72 | # Like my stuff?
73 |
74 | Would you like to buy me a coffee or send me a tip?
75 | While it's not expected, I would really appreciate it.
76 |
77 | [](https://paypal.me/MattSpurrier) Sorry, we've misplaced that URL or it's pointing to something that doesn't exist. Head back home to try finding it again.
10 |9 | | {{ post.title }} | 10 |
18 | {{ post.excerpt }} 19 |
20 |21 | 22 | Read More 23 | 24 |
25 |