17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/middleman-favicon-maker/extension.rb', line 17
def after_build(builder)
template_files = []
::FaviconMaker.generate do
setup do
template_dir options[:template_dir]
output_dir options[:output_dir]
end
options[:icons].each do |input_filename, icon_configs|
from input_filename do
icon_configs.each do |icon_config|
icon icon_config[:icon], icon_config
end
end
end
each_icon do |filepath, template_filepath|
pathname = Pathname.new(filepath)
rel_path =
if pathname.absolute?
pathname.relative_path_from(Pathname.new(app.root)).to_s
else
filepath
end
builder.trigger(:created, rel_path)
end
end
end
|