def minify(pelican):
 for (dirpath, _, filenames) in os.walk(pelican.settings['OUTPUT_PATH']):
  for name in filenames:
   if (os.path.splitext(name)[1] in ('.css', '.js')):
    filepath = os.path.join(dirpath, name)
    logger.info('minifiy %s', filepath)
    verbose = ('-v' if SHOW_OUTPUT else '')
    call('yuicompressor {} --charset utf-8 {} -o {}'.format(verbose, filepath, filepath), shell=True)

def minify ( pelican ) : for ( dirpath , _ , filenames ) in os . walk ( pelican . settings [ 'OUTPUT_PATH' ] ) : for name in filenames : if ( os . path . splitext ( name ) [ 1 ] in ( '.css' , '.js' ) ) : filepath = os . path . join ( dirpath , name ) logger . info ( 'minifiy %s' , filepath ) verbose = ( '-v' if SHOW_OUTPUT else '' ) call ( 'yuicompressor {} --charset utf-8 {} -o {}' . format ( verbose , filepath , filepath ) , shell = True )
minify css and js with yui compressor .