Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could we have an examples.php? #53

Closed
szepeviktor opened this issue Dec 14, 2015 · 4 comments
Closed

Could we have an examples.php? #53

szepeviktor opened this issue Dec 14, 2015 · 4 comments

Comments

@szepeviktor
Copy link
Contributor

Example No1: minit-minify.php

add_filter( 'minit-content-js', 'minit_jsqueeze' );
add_filter( 'minit-content-css', 'minit_cssmin' );

function minit_jsqueeze( $javascript ) {

    // https://github.com/tchwork/jsqueeze
    require_once 'lib/JSqueeze.php';

    $jz = new Patchwork\JSqueeze();

    return $jz->squeeze( $javascript, true, true, false );
}

function minit_cssmin( $stylesheet ) {

    // https://github.com/natxet/CssMin
    require_once 'lib/CssMin.php';

    return CssMin::minify( $stylesheet );
}
@kasparsd
Copy link
Owner

@szepeviktor Awesome, thanks!

There is also an example of minit-exclude-js in include/helpers.php. We should probably add these example to the readme file.

@szepeviktor
Copy link
Contributor Author

lib/ cloud be include/lib/.

@szepeviktor
Copy link
Contributor Author

There is also: https://github.com/ianbogda/CSSqueeze
which seems more advanced.

@szepeviktor
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants