Skip to content

Ruby script to search static HTML/CSS for unused images and delete them

Notifications You must be signed in to change notification settings

DarrenN/static-site-image-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Static Site Image Cleaner

A quick script that uses Nokogiri and my own fork of the CssParser Gem to search your static HTML/CSS for un-used images and delete them.

Still very much beta.

To-Use:

-d Directory you want to check (default is www) -i Directory where your images are stored (default is img)

ex: ruby cleaner.rb -d WWW -i img

or if you make it executable and drop in your bin:

cleaner -d WWW -i img

To test:

$ ruby cleaner.rb

That will run through the www directory in the package and remove any images not being used by .html or .css files.

To-do's

  • Write proper tests

About

Ruby script to search static HTML/CSS for unused images and delete them

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages