diff --git a/lib/gluegun.rb b/lib/gluegun.rb index 7255697..86edf8c 100755 --- a/lib/gluegun.rb +++ b/lib/gluegun.rb @@ -72,6 +72,8 @@ def self.gluegun_generate_pages(site_config_file) end begin File.open(File.join(dest_path,"/#{key2["Slug"]}.html"), "w+") do |f| + # Check if link is valid + open(link) partial_erb_arr.each do |partial_erb| # Set nil to "-" to activate "<%-" and "-%>" characters # for non-printing lines in erb file. @@ -108,8 +110,10 @@ def self.gluegun_generate_pages(site_config_file) def self.reveal(link) begin - response = GitHub::Markdown.render_gfm(open(link).read) - return response + if (!link.nil?) + response = GitHub::Markdown.render_gfm(open(link).read) + return response + end rescue OpenURI::HTTPError end end