Skip to content

Commit

Permalink
Use suggested warning messages
Browse files Browse the repository at this point in the history
  • Loading branch information
pathawks committed Jun 22, 2017
1 parent 5195da5 commit 31347e8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/jekyll/commands/doctor.rb
Expand Up @@ -38,7 +38,7 @@ def healthy?(site)
!deprecated_relative_permalinks(site),
!conflicting_urls(site),
!urls_only_differ_by_case(site),
proper_site_url?(site)
proper_site_url?(site),
].all?
end

Expand Down Expand Up @@ -125,22 +125,21 @@ def case_insensitive_urls(things, destination)

def url_exists?(url)
return true unless url.nil? || url.empty?
Jekyll.logger.warn "Warning:", "Site URL does not appear to be set"
Jekyll.logger.warn "Warning:", "You didn't set an URL in the config file, you may encounter problems with some plugins."
false
end

def url_valid?(url)
Addressable::URI.parse(url)
true
rescue
Jekyll.logger.warn "Warning:", "Cannot parse site URL: #{url}"
Jekyll.logger.warn "Warning:", "The site URL does not seem to be valid, check the value of `url` in your config file."
false
end

def url_absolute(url)
return true if Addressable::URI.parse(url).absolute?
Jekyll.logger.warn "Warning:", "Site URL does not appear to be" \
" absolute: #{url}"
Jekyll.logger.warn "Warning:", "Your site URL does not seem to be absolute, check the value of `url` in your config file."
false
end
end
Expand Down

0 comments on commit 31347e8

Please sign in to comment.