Skip to content

Commit

Permalink
Set favicon
Browse files Browse the repository at this point in the history
  • Loading branch information
drjole committed Oct 18, 2024
1 parent a214c51 commit 2570a43
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 6 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ repos:
types: ["erb"]
entry: bundle
args: ["exec", "erb-format", "--write", "--print-width", "120"]
exclude: ".*\\.json\\.erb"
- id: prettier
name: prettier
language: system
Expand Down
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.
Binary file added app/assets/images/favicon/favicon-48x48.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.
3 changes: 3 additions & 0 deletions app/assets/images/favicon/favicon.svg
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/views/application/_favicon.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<link rel="icon" type="image/png" href="<%= asset_path 'favicon/favicon-48x48.png' %>" sizes="48x48"/>
<link rel="icon" type="image/svg+xml" href="<%= asset_path 'favicon/favicon.svg' %>"/>
<link rel="shortcut icon" href="<%= asset_path 'favicon/favicon.ico' %>"/>
<link rel="apple-touch-icon" sizes="180x180" href="<%= asset_path 'favicon/apple-touch-icon.png' %>"/>
<link rel="manifest" href="<%= pwa_manifest_path(format: :json) %>"/>
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html class="text-[24px] text-white bg-mars bg-no-repeat bg-cover bg-center bg-fixed">
<head>
<title><%= content_for(:title) || "Terraforming Mars Stats" %></title>
<title><%= content_for(:title) || "TM Stats" %></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
Expand All @@ -23,11 +23,13 @@
<%= javascript_importmap_tags %>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

<%= render "application/favicon" %>
</head>

<body class="container mx-auto px-2 my-2">
<%= render "shared/navigation" %>
<%= render "shared/flashes" %>
<%= render "navigation" %>
<%= render "flashes" %>
<%= yield %>
</body>
</html>
27 changes: 24 additions & 3 deletions app/views/pwa/manifest.json.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
{ "name": "Tmstats", "icons": [ { "src": "/icon.png", "type": "image/png", "sizes": "512x512" }, { "src": "/icon.png",
"type": "image/png", "sizes": "512x512", "purpose": "maskable" } ], "start_url": "/", "display": "standalone", "scope":
"/", "description": "Tmstats.", "theme_color": "red", "background_color": "red" }
{
"name": "TM Stats",
"short_name": "TM Stats",
"icons": [
{
"src": "<%= asset_path 'favicon/web-app-manifest-192x192.png' %>",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "<%= asset_path 'favicon/web-app-manifest-512x512.png' %>",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"start_url": "/",
"display": "standalone",
"scope": "/",
"description": "TM Stats",
"theme_color": "#0f172a",
"background_color": "#0f172a"
}

0 comments on commit 2570a43

Please sign in to comment.