25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'lib/jekyll/generators/compile_js.rb', line 25
def generate(site)
handler = WebmentionIO.js_handler
@site = site
@file_name = handler.resource_name
if handler.disabled?
WebmentionIO.log "info", "Skipping JavaScript inclusion."
return
end
if @site.config['serving']
Jekyll::WebmentionIO.log "msg", "A WebmentionIO.js source file will not be generated during `jekyll serve`."
end
@source_file_base_dir = if handler.source? && !@site.config['serving']
@site.in_source_dir()
else
Dir.mktmpdir
end
@destination = handler.destination
@source_file_destination = File.join(@source_file_base_dir, @destination)
@javascript = +""
concatenate_asset_files
add_webmention_types
uglify if handler.uglify?
create_js_file
deploy_js_file if handler.deploy?
end
|