feat: favicon

This commit is contained in:
Max Hohlfeld 2025-06-09 14:09:07 +02:00
parent bce103b086
commit 4dfa29d6f1
9 changed files with 40 additions and 8 deletions

View File

@ -18,6 +18,7 @@ fn main() -> std::io::Result<()> {
let dist_path = Path::new("./static/dist");
let nm_path = Path::new("./static/node_modules");
let static_path = Path::new("./static");
if fs::metadata(dist_path).is_err() {
fs::create_dir(dist_path)?;
@ -43,14 +44,22 @@ fn main() -> std::io::Result<()> {
nm_path.join("hyperscript.org/dist/_hyperscript.min.js"),
dist_path.join("_hyperscript.min.js"),
)?;
copy(
Path::new("./static/utils.js"),
dist_path.join("utils.js"),
)?;
copy(
Path::new("./static/brass.jpeg"),
dist_path.join("brass.jpeg"),
)?;
let static_files = vec![
"utils.js",
"brass.jpeg",
"android-chrome-192x192.png",
"android-chrome-512x512.png",
"apple-touch-icon.png",
"favicon-16x16.png",
"favicon-32x32.png",
"favicon.ico",
"site.webmanifest",
];
for file in static_files {
copy(static_path.join(file), dist_path.join(file))?;
}
resource_dir("./static/dist").build()
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 881 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
web/static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -0,0 +1,19 @@
{
"name": "Brass",
"short_name": "Brass",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#FFFFFF",
"background_color": "#FFFFFF",
"display": "standalone"
}

View File

@ -11,6 +11,10 @@
<script src="/static/sweetalert2.min.js"></script>
<script src="/static/_hyperscript.min.js"></script>
<script type="module" src="/static/utils.js"></script>
<link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png">
<link rel="manifest" href="/static/site.webmanifest">
</head>
<body class="hero is-fullheight" hx-ext="response-targets">