• Stars
    star
    135
  • Rank 263,453 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created over 5 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A mkdocs plugin to minify the HTML of a page before it is written to disk.

mkdocs-minify-plugin

PyPI - Python Version

An MkDocs plugin to minify HTML, JS or CSS files prior to being written to disk.

HTML minification is done using htmlmin.

JS minification is done using jsmin.

CSS minification is done using csscompressor.

Setup

Install the plugin using pip:

pip install mkdocs-minify-plugin

Activate the plugin in mkdocs.yml:

plugins:
  - search
  - minify:
      minify_html: true
      minify_js: true
      minify_css: true
      htmlmin_opts:
          remove_comments: true
      cache_safe: true
      js_files:
          - my/javascript/dir/file1.js
          - my/javascript/dir/file2.js
      css_files:
          - my/css/dir/file1.css
          - my/css/dir/file2.css

Note: If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set, but now you have to enable it explicitly.

Options

  • minify_html:
    • Defaults to False.
    • Sets whether HTML files should be minified.
  • minify_js:
    • Defaults to False.
    • Sets whether JS files should be minified.
      If set to True, you must specify the JS to be minified files using js_files (see below).
  • minify_css:
    • Defaults to False.
    • Sets whether CSS files should be minified.
      If set to True, you must specify the CSS to be minified files using css_files (see below).
  • htmlmin_opts:
  • cache_safe:
    • Defaults to False.
    • Sets whether a hash should be added to the JS and CSS file names. This ensures that the browser always loads the latest version of the files instead of loading them from the cache.
      If set to True, you must specify the files using js_files or css_files (see below).
  • js_files:
    • Defaults to None.
    • List of JS files to be minified.
      The plugin will generate minified versions of these files and save them as .min.js in the output directory.
  • css_files:
    • Defaults to None.
    • List of CSS files to be minified.
      The plugin will generate minified versions of these files and save them as .min.css in the output directory.

Note: When using minify_js or minify_css, you don't have to modify the extra_javascript or extra_css entries in your mkdocs.yml file. The plugins automatically takes care of that.

More Repositories

1

uphold-sdk-python

An SDK for the Uphold API.
Python
47
star
2

mkdocs-bootstrap4

Bootstrap 4.0+ theme for MkDocs
HTML
43
star
3

mkdocs-git-committers-plugin

A mkdocs plugin for displaying the last commit and a list of a file's contributors.
Python
35
star
4

mkdocs-plugin-template

A template for creating mkdocs plugins
Python
18
star
5

mt-theme-midcentury

A fork of the popular Mid-Century Template Set for Movable Type with tons more features.
JavaScript
16
star
6

jquery-mtgreet

A jQuery plugin for blog-side javascript
JavaScript
14
star
7

mt-plugin-assetgallery

A plugin for Movable Type that allows users to embed a photo gallery within a blog post using Movable Type Pro and custom fields.
JavaScript
14
star
8

melody-installer

A drop-in all purpose do everything make it work installer script for Open Melody.
13
star
9

mt-plugin-imagecropper

A Movable Type plugin to assist in the generation of a set array of thumbnails conforming to size requirements defined by the user.
JavaScript
13
star
10

mkdocs-bootstrap-tables-plugin

A MkDocs plugin to add bootstrap classes to plan markdown generated tables.
Python
11
star
11

mt-plugin-comment-subscribe

A plugin for Movable Type that keeps readers updated when people submit follow up comments.
Perl
10
star
12

mt-plugin-mediamanager

Media Manager is a plugin that allows you to easily add YouTube videos, Amazon items and Flickr Photos to your blog posts.
Perl
10
star
13

mt-plugin-twitterapi

A Movable Type and Melody plugin that adds TwitterAPI support to your blog.
Perl
9
star
14

mt-plugin-profiler

A plugin to display a nice report detailing the performance characteristic of any template.
JavaScript
8
star
15

mkdocs-swagger-ui

Python
8
star
16

mt-plugin-fullscreen

A plugin for Movable Type that allows you to toggle your template and entry editor to the screen's full width.
Perl
8
star
17

mt-plugin-pqmanager

A Movable Type plugin that provides an enhanced administrative interface for the Publish Queue.
Perl
8
star
18

mt-plugin-customcss

A Movable Type plugin that provides a simpler way of allowing users to edit and customize their sites CSS.
Perl
8
star
19

mt-plugin-pagelayout

A Movable Type plugin that provides the ability to select the template you want to use when publishing an entry or page.
8
star
20

jquery-thickbox-byrne

This is a fork of the jQuery thickbox plugin which make it compatible with jQuery 1.3.1.
JavaScript
7
star
21

mt-plugin-autoprefs

A plugin for Movable Type that makes it easy to encapsulate and apply a set of blog preferences to a blog.
Perl
7
star
22

mt-tool-exportts

A tool for Movable Type that allows you to easily export the templates in a blog as a template set.
Perl
7
star
23

mt-plugin-cf-widgetset

A plugin for Movable Type that defines a new Custom Field type: a pull down menu of all the widget sets in your blog.
Perl
7
star
24

mt-plugin-expire

A Movable Type and Melody plugin to add support for auto-expiring and unpublishing entries.
Perl
7
star
25

jquery-mtcomment

A jQuery plugin for inline AJAX commenting on a Movable Type blog.
JavaScript
7
star
26

mt-plugin-openfields

A plugin for Movable Type that provides an open source custom fields solution.
Perl
7
star
27

mt-plugin-featuredassets

A Movable Type plugin that provides the ability to feature assets more easily from within the MT UI
Perl
7
star
28

mt-plugin-thatshot

A Movable Type and Melody plugin that allows editors to manage topics on their web site, where a topic is a simple way of aggregating related stories together into a more focused vertical.
Perl
7
star
29

mt-plugin-extratags

A Movable Type plugin that provides a collection of extra template tags
Perl
6
star
30

mt-theme-hybridnews

A port of the Hybrid News theme from WordPress to Movable Type
JavaScript
6
star
31

mt-plugin-customheader

A Movable Type plugin that makes it easy to customize your blog's header image.
JavaScript
6
star
32

mt-plugin-autolink

A Movable Type plugin that automattically adds links to words and phrases you choose.
Perl
6
star
33

mt-plugin-forumutils

A Movable Type plugin that adds support for featured comments, entries, and other forum like features.
Perl
6
star
34

mt-plugin-send2pq

A Movable Type and Melody plugin that will instruct the system to send every file of a blog to the publish queue to be published at the next possible convenience.
Perl
6
star
35

mt-plugin-podcasting

A plugin for Movable Type that provides enhanced capabilities to the MT CMS for podcasters.
Perl
6
star
36

mt-plugin-photogallery

A Movable Type plugin that provides the Mid-Century Photo Gallery theme and added functionality for managing photos.
Perl
6
star
37

mkdocs-moonstone

A documentation theme for mkdocs.
CSS
5
star
38

mt-plugin-userexport

Export your Movable Type user database along with custom field data.
Perl
5
star
39

mt-plugin-enhancedmemberlisting

A Movable Type plugin that provides a redesigned and enhanced member management UI.
Perl
5
star
40

mt-plugin-linktotheme

A Movable Type and Melody plugin to add support for linking templates to theme files to avoid the need to refresh templates.
Perl
5
star
41

mt-plugin-facebook-connect-commenters

Allows Facebook users to log in and leave comments.
Perl
5
star
42

mt-theme-midcentury-mob

A theme for Movable Type that provides an iPhone optimized version of your blog.
JavaScript
5
star
43

mt-plugin-openid-wordpress

A Movable Type plugin that provides an enhanced login experience for WordPress.com users.
Perl
5
star
44

mt-theme-revolution-charred

A port of the Revolution Charred theme from WordPress to Movable Type.
JavaScript
5
star
45

mt-plugin-maximagewidth

A Movable Type and Melody plugin that provides a way to enforce a max image or thumbnail width for uploaded images to prevent users from uploading photos too wide for a column.
JavaScript
5
star
46

mt-plugin-superpage

A Movable Type plugin that fragments a large page into multiple and auto-generates a table of contents for you.
Perl
5
star
47

mt-plugin-supr

A plugin for Movable Type and Melody that provides integration with Stumple Upon's URL shortening service and iframe viewing window.
Perl
5
star
48

jquery-tags

A jquery plugin that provides a simple list management UI inspired by the controls used for adding and removing tags to a post in blogging or a photo in Flickr.
JavaScript
5
star
49

melody-docs

A collection of open source documentation for the Melody platform.
4
star
50

mt-plugin-refreshpublish

A plugin for Movable Type that refreshes and publishes index template in a single go.
Perl
4
star
51

mt-plugin-fluidapp

A Movable Type plugin that provides enhanced capabilities for Mac OS X users running MT under Fluid App.
JavaScript
4
star
52

mt-plugin-defensio

A Movable Type plugin that filters comments through the Defensio antispam service.
Perl
4
star
53

mt-plugin-notifywho

A plugin for Movable Type that allows you to notify individuals and mailings of new entries and comments.
Perl
4
star
54

mt-plugin-sample

This is a simple template for a Movable Type plugin. I have created enough of these where I need a good and simple starting point.
Perl
4
star
55

mt-auth-opensso

Open SSO (single sign on) driver for Movable Type and Melody.
Perl
4
star
56

mt-plugin-promotethis

A plugin for Movable Type that makes it easy to add "Digg This" and other sharing links on your blog.
Perl
4
star
57

mt-plugin-batchtmploptions

A plugin for Movable Type that allows you to set publishing options in a batch operation.
Perl
4
star
58

mkdocs-markdown-filter

Adds a markdown template filter to the jinja templating environment in mkdocs.
Python
3
star
59

perl-XML-Sig

A toolkit for XML digital signature creation and verification
Perl
3
star
60

mt-plugin-cf-twodimselect

A Movable Type Pro plugin that adds support for a two-dimensional pull down menu; select an item in one menu to reveal a second.
Perl
3
star
61

mt-plugin-pingback

A plugin for Movable Type that implements PingBack for Movable Type.
Perl
3
star
62

mt-plugin-picapp

A Movable Type and Melody plugin that adds support for the PicApp image distribution service.
Perl
3
star
63

mt-plugin-cachemanager

A plugin for Movable that provides additional functionality to assist in the management of template module caches.
Perl
3
star
64

mt-plugin-melody-maker

A plugin for Melody which employs a new user interface for the application. "Melody Maker" gets its name partially from the ability given to users to modify and customize the Melody UI for their own purposes.
CSS
3
star
65

mt-plugin-cleansweep

A Movable Type and Melody plugin to help administrators manage 404s on their site and redirect users to the proper/desired content.
Perl
3
star
66

mt-plugin-unrecognizedtags

Movable Type plugin for identifying unrecognized tags in use in templates
Perl
3
star
67

mt-plugin-openid-yahoo

A Movable Type plugin that provides an enhanced login experience for Yahoo users.
Perl
3
star
68

perl-File-Download

A perl module for downloading large files.
Perl
3
star
69

mt-plugin-404checker

A plugin for Movable Type that helps reduce the number of 404s on your web site.
Perl
3
star
70

codechecker-mkdocs

Python
2
star
71

github-action-mkdocs-link-check

Shell
2
star
72

glip-chatbot-aha

JavaScript
2
star
73

perl-Net-PicApp

A perl library and toolkit for interacting with the PicApp web service.
Perl
1
star
74

ghost-migration-service

JavaScript
1
star
75

php-Tender-Multipass

A library for generating TenderApp multipass tokens in PHP
PHP
1
star
76

mkdocs-ringcentral

A mkdocs theme for RingCentral documentation projects.
HTML
1
star
77

ringcentral-semantic

A proof of concept node module for providing a light-weight wrapper around ringcentral-js-concise that is less abstract.
JavaScript
1
star
78

demo-repos

1
star
79

mt-plugin-simplejsonapi

Perl
1
star