Geometric logo

This commit is contained in:
spikecodes 2021-02-25 09:07:45 -08:00
parent a3ec44149c
commit 5d643277bc
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB
10 changed files with 22 additions and 51 deletions

45
Cargo.lock generated
View file

@ -286,7 +286,7 @@ dependencies = [
"async-io",
"async-lock",
"async-process",
"crossbeam-utils 0.8.2",
"crossbeam-utils 0.8.3",
"futures-channel",
"futures-core",
"futures-io",
@ -565,14 +565,13 @@ dependencies = [
[[package]]
name = "crossbeam-utils"
version = "0.8.2"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bae8f328835f8f5a6ceb6a7842a7f2d0c03692adb5c889347235d59194731fe3"
checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49"
dependencies = [
"autocfg",
"cfg-if 1.0.0",
"lazy_static",
"loom",
]
[[package]]
@ -865,19 +864,6 @@ dependencies = [
"slab",
]
[[package]]
name = "generator"
version = "0.6.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9fed24fd1e18827652b4d55652899a1e9da8e54d91624dc3437a5bc3a9f9a9c"
dependencies = [
"cc",
"libc",
"log",
"rustversion",
"winapi",
]
[[package]]
name = "generic-array"
version = "0.14.4"
@ -1050,7 +1036,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2948a0ce43e2c2ef11d7edf6816508998d99e13badd1150be0914205df9388a"
dependencies = [
"bytes 0.5.6",
"crossbeam-utils 0.8.2",
"crossbeam-utils 0.8.3",
"curl",
"curl-sys",
"flume",
@ -1173,17 +1159,6 @@ dependencies = [
"value-bag",
]
[[package]]
name = "loom"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d44c73b4636e497b4917eb21c33539efa3816741a2d3ff26c6316f1b529481a4"
dependencies = [
"cfg-if 1.0.0",
"generator",
"scoped-tls",
]
[[package]]
name = "matches"
version = "0.1.8"
@ -1478,12 +1453,6 @@ dependencies = [
"semver",
]
[[package]]
name = "rustversion"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd"
[[package]]
name = "ryu"
version = "1.0.5"
@ -1500,12 +1469,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "scoped-tls"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
[[package]]
name = "scopeguard"
version = "1.1.0"

View file

@ -63,7 +63,7 @@ async fn iphone_logo(_req: Request<()>) -> tide::Result {
Ok(
Response::builder(200)
.content_type("image/png")
.body(include_bytes!("../static/touch-icon-iphone.png").as_ref())
.body(include_bytes!("../static/apple-touch-icon.png").as_ref())
.build(),
)
}
@ -71,9 +71,9 @@ async fn iphone_logo(_req: Request<()>) -> tide::Result {
async fn favicon(_req: Request<()>) -> tide::Result {
Ok(
Response::builder(200)
.content_type("image/vnd.microsoft.icon")
.content_type("image/png")
.header("Cache-Control", "public, max-age=1209600, s-maxage=86400")
.body(include_bytes!("../static/favicon.ico").as_ref())
.body(include_bytes!("../static/favicon.png").as_ref())
.build(),
)
}
@ -154,9 +154,11 @@ async fn main() -> tide::Result<()> {
// Read static files
app.at("/style.css/").get(|_| resource(include_str!("../static/style.css"), "text/css", false));
app.at("/manifest.json/").get(|_| resource(include_str!("../static/manifest.json"), "application/json", false));
app
.at("/manifest.json/")
.get(|_| resource(include_str!("../static/manifest.json"), "application/json", false));
app.at("/robots.txt/").get(|_| resource("User-agent: *\nAllow: /", "text/plain", true));
app.at("/favicon.ico/").get(favicon);
app.at("/favicon.png/").get(favicon);
app.at("/logo.png/").get(pwa_logo);
app.at("/touch-icon-iphone.png/").get(iphone_logo);
app.at("/apple-touch-icon.png/").get(iphone_logo);

View file

@ -143,7 +143,8 @@ pub struct GalleryMedia {
impl GalleryMedia {
fn parse(items: &Value, metadata: &Value) -> Vec<Self> {
items.as_array()
items
.as_array()
.unwrap_or(&Vec::new())
.iter()
.map(|item| {
@ -497,7 +498,12 @@ pub fn redirect(path: String) -> Response {
}
pub async fn error(req: Request<()>, msg: String) -> tide::Result {
let body = ErrorTemplate { msg, prefs: Preferences::new(req) }.render().unwrap_or_default();
let body = ErrorTemplate {
msg,
prefs: Preferences::new(req),
}
.render()
.unwrap_or_default();
Ok(Response::builder(404).content_type("text/html").body(body).build())
}

BIN
static/apple-touch-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 789 B

BIN
static/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View file

@ -12,8 +12,8 @@
"type": "image/png"
},
{
"src": "touch-icon-iphone.png",
"sizes": "152x152"
"src": "apple-touch-icon.png",
"sizes": "180x180"
},
{
"src": "favicon.ico",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View file

@ -18,7 +18,7 @@
<link href="/touch-icon-iphone.png/" rel="apple-touch-icon">
<!-- PWA Manifest -->
<link rel="manifest" type="application/json" href="/manifest.json/">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico/">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon.png">
<link rel="stylesheet" type="text/css" href="/style.css/">
{% endblock %}
</head>