-
Notifications
You must be signed in to change notification settings - Fork 1
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
Multiple filters support for layouts. #62
Comments
Hey there, At the moment, the easiest (though a little repetitive) way to do this is to call compile '/**/*.md' do
filter :kramdown
layout '/default.*'
filter :minify
end
layout '/**/*.erb', :erb The If two filters always need to happen in succession, then it might be worth having a way to explicitly combine filters. Something like this: Nanoc::Filter.combine([:erb, :minify] => :my_erb) (You’d still need to define your own |
Nanoc::Filter.combine([:erb, :minify] => :my_erb) That seems nice ! This is what I had imagined: layout '**/*', [:erb, :minify] I could see this working too: layout '**/*', Nanoc::Filter.combine([:erb, :minify]) My only suggestion would be to not make a name of the combined filters required. I think it can be redundant (like in the examples above), and introduce a new filter name that is kind of strange (like Thanks! |
Hey 👋 I'm cleaning up my issue list. Not clear if this one is actionable or not. Please feel free to close if it is taking up space among legitimate issues. |
Hello !
I would like to first say, thank you for all your work on nanoc. I love it !
This issue is a feature request (maybe it's already possible, but I couldn't figure out how).
I would like to apply multiple filters to a layout - at the moment I could only figure out how to apply one filter (eg
erb
). The reason is that I would like to run theerb
filter, followed by a custom filter that minifies the result of theerb
filter.The solution I came up with is this - but it is less than ideal because it implies using
erb
all the time, and I didn't see an easy way to avoid that.Gist:
The text was updated successfully, but these errors were encountered: