Geometric logo
This commit is contained in:
parent
a3ec44149c
commit
5d643277bc
45
Cargo.lock
generated
45
Cargo.lock
generated
@ -286,7 +286,7 @@ dependencies = [
|
|||||||
"async-io",
|
"async-io",
|
||||||
"async-lock",
|
"async-lock",
|
||||||
"async-process",
|
"async-process",
|
||||||
"crossbeam-utils 0.8.2",
|
"crossbeam-utils 0.8.3",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-io",
|
"futures-io",
|
||||||
@ -565,14 +565,13 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "crossbeam-utils"
|
name = "crossbeam-utils"
|
||||||
version = "0.8.2"
|
version = "0.8.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bae8f328835f8f5a6ceb6a7842a7f2d0c03692adb5c889347235d59194731fe3"
|
checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"cfg-if 1.0.0",
|
"cfg-if 1.0.0",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"loom",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -865,19 +864,6 @@ dependencies = [
|
|||||||
"slab",
|
"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]]
|
[[package]]
|
||||||
name = "generic-array"
|
name = "generic-array"
|
||||||
version = "0.14.4"
|
version = "0.14.4"
|
||||||
@ -1050,7 +1036,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "e2948a0ce43e2c2ef11d7edf6816508998d99e13badd1150be0914205df9388a"
|
checksum = "e2948a0ce43e2c2ef11d7edf6816508998d99e13badd1150be0914205df9388a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytes 0.5.6",
|
"bytes 0.5.6",
|
||||||
"crossbeam-utils 0.8.2",
|
"crossbeam-utils 0.8.3",
|
||||||
"curl",
|
"curl",
|
||||||
"curl-sys",
|
"curl-sys",
|
||||||
"flume",
|
"flume",
|
||||||
@ -1173,17 +1159,6 @@ dependencies = [
|
|||||||
"value-bag",
|
"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]]
|
[[package]]
|
||||||
name = "matches"
|
name = "matches"
|
||||||
version = "0.1.8"
|
version = "0.1.8"
|
||||||
@ -1478,12 +1453,6 @@ dependencies = [
|
|||||||
"semver",
|
"semver",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rustversion"
|
|
||||||
version = "1.0.4"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ryu"
|
name = "ryu"
|
||||||
version = "1.0.5"
|
version = "1.0.5"
|
||||||
@ -1500,12 +1469,6 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "scoped-tls"
|
|
||||||
version = "1.0.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "scopeguard"
|
name = "scopeguard"
|
||||||
version = "1.1.0"
|
version = "1.1.0"
|
||||||
|
12
src/main.rs
12
src/main.rs
@ -63,7 +63,7 @@ async fn iphone_logo(_req: Request<()>) -> tide::Result {
|
|||||||
Ok(
|
Ok(
|
||||||
Response::builder(200)
|
Response::builder(200)
|
||||||
.content_type("image/png")
|
.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(),
|
.build(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -71,9 +71,9 @@ async fn iphone_logo(_req: Request<()>) -> tide::Result {
|
|||||||
async fn favicon(_req: Request<()>) -> tide::Result {
|
async fn favicon(_req: Request<()>) -> tide::Result {
|
||||||
Ok(
|
Ok(
|
||||||
Response::builder(200)
|
Response::builder(200)
|
||||||
.content_type("image/vnd.microsoft.icon")
|
.content_type("image/png")
|
||||||
.header("Cache-Control", "public, max-age=1209600, s-maxage=86400")
|
.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(),
|
.build(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -154,9 +154,11 @@ async fn main() -> tide::Result<()> {
|
|||||||
|
|
||||||
// Read static files
|
// Read static files
|
||||||
app.at("/style.css/").get(|_| resource(include_str!("../static/style.css"), "text/css", false));
|
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("/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("/logo.png/").get(pwa_logo);
|
||||||
app.at("/touch-icon-iphone.png/").get(iphone_logo);
|
app.at("/touch-icon-iphone.png/").get(iphone_logo);
|
||||||
app.at("/apple-touch-icon.png/").get(iphone_logo);
|
app.at("/apple-touch-icon.png/").get(iphone_logo);
|
||||||
|
10
src/utils.rs
10
src/utils.rs
@ -143,7 +143,8 @@ pub struct GalleryMedia {
|
|||||||
|
|
||||||
impl GalleryMedia {
|
impl GalleryMedia {
|
||||||
fn parse(items: &Value, metadata: &Value) -> Vec<Self> {
|
fn parse(items: &Value, metadata: &Value) -> Vec<Self> {
|
||||||
items.as_array()
|
items
|
||||||
|
.as_array()
|
||||||
.unwrap_or(&Vec::new())
|
.unwrap_or(&Vec::new())
|
||||||
.iter()
|
.iter()
|
||||||
.map(|item| {
|
.map(|item| {
|
||||||
@ -497,7 +498,12 @@ pub fn redirect(path: String) -> Response {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn error(req: Request<()>, msg: String) -> tide::Result {
|
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())
|
Ok(Response::builder(404).content_type("text/html").body(body).build())
|
||||||
}
|
}
|
||||||
|
BIN
static/apple-touch-icon.png
Normal file
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
BIN
static/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 969 B |
BIN
static/logo.png
BIN
static/logo.png
Binary file not shown.
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 7.9 KiB |
@ -12,8 +12,8 @@
|
|||||||
"type": "image/png"
|
"type": "image/png"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "touch-icon-iphone.png",
|
"src": "apple-touch-icon.png",
|
||||||
"sizes": "152x152"
|
"sizes": "180x180"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"src": "favicon.ico",
|
"src": "favicon.ico",
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
@ -18,7 +18,7 @@
|
|||||||
<link href="/touch-icon-iphone.png/" rel="apple-touch-icon">
|
<link href="/touch-icon-iphone.png/" rel="apple-touch-icon">
|
||||||
<!-- PWA Manifest -->
|
<!-- PWA Manifest -->
|
||||||
<link rel="manifest" type="application/json" href="/manifest.json/">
|
<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/">
|
<link rel="stylesheet" type="text/css" href="/style.css/">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
|
Loading…
Reference in New Issue
Block a user