Skip to content
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

Bugfixes 2017 07 31 #49

Merged
merged 3 commits into from
Jul 31, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/jekyll/generators/compile_js.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ module Jekyll
module WebmentionIO
class JavaScriptFile < StaticFile
def destination_rel_dir
Jekyll::WebmentionIO::config['js']['destination'] || '/js/'
config = {
'destination' => 'js'
}
js_config = Jekyll::WebmentionIO::config['js'] || {}
config = config.merge(js_config)
config['destination']
end
end

Expand All @@ -28,7 +33,7 @@ def generate(site)
end

config = {
'destination' => "js",
'destination' => 'js',
'uglify' => true
}
site_config = site.config['webmentions']['js'] || {}
Expand Down Expand Up @@ -66,7 +71,6 @@ def generate(site)
# Generate the file
file_name = 'JekyllWebmentionIO.js'
source_file_destination = ( config['source'] == false ? Dir.mktmpdir : "#{site.config['source']}/#{config['destination']}" )
puts source_file_destination
Dir.mkdir( source_file_destination ) unless File.exists?( source_file_destination )
File.open("#{source_file_destination}/#{file_name}", 'w') { |f| f.write( javascript ) }
unless config['deploy'] == false
Expand Down