diff --git a/lib/helpers.rb b/lib/helpers.rb index 2931d87ba..f7abe2206 100644 --- a/lib/helpers.rb +++ b/lib/helpers.rb @@ -5,7 +5,11 @@ module Helpers def retina_srcset(path) return "#{path}" if path =~ /^http(s)?/ - "#{path.gsub(/\./, '@2x.')} 2x" + if File.exist?("source/#{path.gsub(/\./, '@2x.')}") + "#{path.gsub(/\./, '@2x.')} 2x" + elsif File.exist?("source/#{path.gsub(/\./, '-2x.')}") + "#{path.gsub(/\./, '-2x.')} 2x" + end end def site_nav_link(link_text, href, options = {})