winton / stasis

Static sites made powerful
http://stasis.me
MIT License
679 stars 56 forks source link

Request: running filters on files #44

Open bomberstudios opened 12 years ago

bomberstudios commented 12 years ago

There's one thing I used quite a lot with nanoc, and think would make a killer addition to stasis: file filters.

The idea would work something like this:

# controller.rb

before /*.png/ do
  filter some_method
end

where some_method takes a file path as argument, transforms the file, and sends it back to stasis.

It would be great for image files (for running them through smusher, for example)

kammerer commented 12 years ago

It seems that instead should do exactly what you want:

before /\.png$/ do
  instead MyFancyFilter.process(_stasis.path)
end