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

add favicon #214

Merged
merged 2 commits into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
//= link favicon/site.webmanifest
//= link favicon/browserconfig.xml
//= link_tree ../../javascript .js
//= link_tree ../../../vendor/javascript .js
//= link_tree ../builds
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions app/assets/images/favicon/browserconfig.xml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="<%= asset_path 'favicon/mstile-150x150.png' %>"/>
<TileColor>#da532c</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file added app/assets/images/favicon/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/favicon/favicon.ico
Binary file not shown.
Binary file added app/assets/images/favicon/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions app/assets/images/favicon/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions app/assets/images/favicon/site.webmanifest.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "ParisRB",
"short_name": "ParisRB",
"icons": [
{
"src": "<%= asset_path 'favicon/android-chrome-192x192.png' %>",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "<%= asset_path 'favicon/android-chrome-256x256.png' %>",
"sizes": "256x256",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
Binary file added app/assets/images/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions app/views/application/_favicon.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<link rel="apple-touch-icon" sizes="180x180" href="<%= asset_path 'favicon/apple-touch-icon.png' %>">
<link rel="icon" type="image/png" sizes="32x32" href="<%= asset_path 'favicon/favicon-32x32.png' %>">
<link rel="icon" type="image/png" sizes="16x16" href="<%= asset_path 'favicon/favicon-16x16.png' %>">
<link rel="manifest" href="<%= asset_path 'favicon/site.webmanifest' %>">
<link rel="mask-icon" href="<%= asset_path 'favicon/safari-pinned-tab.svg' %>" color="#5bbad5">
<link rel="shortcut icon" href="<%= asset_path 'favicon/favicon.ico' %>">
<meta name="apple-mobile-web-app-title" content="ParisRB">
<meta name="application-name" content="ParisRB">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="msapplication-config" content="<%= asset_path 'favicon/browserconfig.xml' %>">
<meta name="theme-color" content="#ffffff">
1 change: 1 addition & 0 deletions app/views/layouts/application.html+new.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<% end %>

<%= display_meta_tags reverse: true, site: t('site_name'), separator: '·' %>
<%= render 'application/favicon' %>

<%= csrf_meta_tags %>
<%= csp_meta_tag %>
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/application.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ html lang="fr"
meta name="google-site-verification" content="#{ENV["GOOGLE_WEB_TOOLS_ID"]}"

= display_meta_tags reverse: true, site: t('site_name'), separator: '·'
= render 'application/favicon'

= stylesheet_link_tag '//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css'
= stylesheet_link_tag 'application'
Expand Down
60 changes: 60 additions & 0 deletions config/favicon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"master_picture": "app/assets/images/icon.png",
"favicon_design": {
"ios": {
"picture_aspect": "no_change",
"assets": {
"ios6_and_prior_icons": false,
"ios7_and_later_icons": false,
"precomposed_icons": false,
"declare_only_default_icon": true
},
"app_name": "ParisRB"
},
"desktop_browser": {
"design": "raw"
},
"windows": {
"picture_aspect": "no_change",
"background_color": "#da532c",
"on_conflict": "override",
"assets": {
"windows_80_ie_10_tile": false,
"windows_10_ie_11_edge_tiles": {
"small": false,
"medium": true,
"big": false,
"rectangle": false
}
},
"app_name": "ParisRB"
},
"android_chrome": {
"picture_aspect": "no_change",
"theme_color": "#ffffff",
"manifest": {
"name": "ParisRB",
"display": "standalone",
"orientation": "not_set",
"on_conflict": "override",
"declared": true
},
"assets": {
"legacy_icon": false,
"low_resolution_icons": false
}
},
"safari_pinned_tab": {
"picture_aspect": "black_and_white",
"threshold": 55.46875,
"theme_color": "#5bbad5"
}
},
"settings": {
"scaling_algorithm": "Mitchell",
"error_on_image_too_small": false,
"readme_file": false,
"html_code_file": false,
"use_path_as_is": false
}
}
18 changes: 18 additions & 0 deletions config/initializers/web_app_manifest.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file was generated by rails_favicon_generator, from
# https://realfavicongenerator.net/

# It makes files with .webmanifest extension first class files in the asset
# pipeline. This is to preserve this extension, as is it referenced in a call
# to asset_path in the _favicon.html.erb partial.

Rails.application.config.assets.configure do |env|
mime_type = "application/manifest+json"
extensions = [ ".webmanifest" ]

if Sprockets::VERSION.to_i >= 4
extensions << ".webmanifest.erb"
env.register_preprocessor(mime_type, Sprockets::ERBProcessor)
end

env.register_mime_type(mime_type, extensions: extensions)
end
Loading