Merge pull request #43850 from hachi8833/fix_favicon_link_tag

Remove "shortcut" link type from favicon_link_tag method
This commit is contained in:
Rafael Mendonça França 2021-12-14 20:37:34 -05:00 committed by GitHub
commit 68f4fbc7cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 9 deletions

@ -258,14 +258,14 @@ def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {})
#
# The helper gets the name of the favicon file as first argument, which
# defaults to "favicon.ico", and also supports +:rel+ and +:type+ options
# to override their defaults, "shortcut icon" and "image/x-icon"
# to override their defaults, "icon" and "image/x-icon"
# respectively:
#
# favicon_link_tag
# # => <link href="/assets/favicon.ico" rel="shortcut icon" type="image/x-icon" />
# # => <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
#
# favicon_link_tag 'myicon.ico'
# # => <link href="/assets/myicon.ico" rel="shortcut icon" type="image/x-icon" />
# # => <link href="/assets/myicon.ico" rel="icon" type="image/x-icon" />
#
# Mobile Safari looks for a different link tag, pointing to an image that
# will be used if you add the page to the home screen of an iOS device.
@ -275,7 +275,7 @@ def auto_discovery_link_tag(type = :rss, url_options = {}, tag_options = {})
# # => <link href="/assets/mb-icon.png" rel="apple-touch-icon" type="image/png" />
def favicon_link_tag(source = "favicon.ico", options = {})
tag("link", {
rel: "shortcut icon",
rel: "icon",
type: "image/x-icon",
href: path_to_image(source, skip_pipeline: options.delete(:skip_pipeline))
}.merge!(options.symbolize_keys))

@ -238,8 +238,8 @@ def content_security_policy_nonce
}
FaviconLinkToTag = {
%(favicon_link_tag) => %(<link href="/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />),
%(favicon_link_tag 'favicon.ico') => %(<link href="/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />),
%(favicon_link_tag) => %(<link href="/images/favicon.ico" rel="icon" type="image/x-icon" />),
%(favicon_link_tag 'favicon.ico') => %(<link href="/images/favicon.ico" rel="icon" type="image/x-icon" />),
%(favicon_link_tag 'favicon.ico', :rel => 'foo') => %(<link href="/images/favicon.ico" rel="foo" type="image/x-icon" />),
%(favicon_link_tag 'favicon.ico', :rel => 'foo', :type => 'bar') => %(<link href="/images/favicon.ico" rel="foo" type="bar" />),
%(favicon_link_tag 'mb-icon.png', :rel => 'apple-touch-icon', :type => 'image/png') => %(<link href="/images/mb-icon.png" rel="apple-touch-icon" type="image/png" />)

@ -7,7 +7,7 @@
<link rel="stylesheet" type="text/css" href="stylesheets/style.css" data-turbolinks-track="reload">
<link rel="stylesheet" type="text/css" href="stylesheets/print.css" media="print">
<link rel="stylesheet" type="text/css" href="stylesheets/highlight.css" data-turbolinks-track="reload">
<link href="images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link href="images/favicon.ico" rel="icon" type="image/x-icon" />
<script src="javascripts/turbolinks.js" data-turbolinks-track="reload"></script>
<script src="javascripts/clipboard.js" data-turbolinks-track="reload"></script>
<script src="javascripts/guides.js" data-turbolinks-track="reload"></script>

@ -5,7 +5,7 @@
<title>Ruby on Rails</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<link rel="shortcut icon" href="<%= ruby_on_rails_logo_favicon_data_uri %>" />
<link rel="icon" href="<%= ruby_on_rails_logo_favicon_data_uri %>" />
<style type="text/css">
* {

@ -77,7 +77,7 @@ class ::PostsController < ActionController::Base ; end
javascript_path: %r{/javascripts/#{contents}},
stylesheet_path: %r{/stylesheets/#{contents}},
image_tag: %r{<img src="/images/#{contents}"},
favicon_link_tag: %r{<link rel="shortcut icon" type="image/x-icon" href="/images/#{contents}" />},
favicon_link_tag: %r{<link rel="icon" type="image/x-icon" href="/images/#{contents}" />},
stylesheet_link_tag: %r{<link rel="stylesheet" href="/stylesheets/#{contents}.css" />},
javascript_include_tag: %r{<script src="/javascripts/#{contents}.js">},
audio_tag: %r{<audio src="/audios/#{contents}"></audio>},