mirror of
https://git.joinplu.me/Plume/Plume.git
synced 2024-12-18 08:16:27 +00:00
Add webapp manifest
This commit is contained in:
parent
bfbd4e4646
commit
2f166bab49
3 changed files with 16 additions and 0 deletions
|
@ -64,6 +64,7 @@ fn main() {
|
||||||
routes::instance::shared_inbox,
|
routes::instance::shared_inbox,
|
||||||
routes::instance::nodeinfo,
|
routes::instance::nodeinfo,
|
||||||
routes::instance::about,
|
routes::instance::about,
|
||||||
|
routes::instance::web_manifest,
|
||||||
|
|
||||||
routes::likes::create,
|
routes::likes::create,
|
||||||
routes::likes::create_auth,
|
routes::likes::create_auth,
|
||||||
|
|
|
@ -154,3 +154,17 @@ fn about(user: Option<User>, conn: DbConn) -> Template {
|
||||||
"n_instances": Instance::count(&*conn) - 1
|
"n_instances": Instance::count(&*conn) - 1
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[get("/manifest.json")]
|
||||||
|
fn web_manifest(conn: DbConn) -> Json<serde_json::Value> {
|
||||||
|
let instance = Instance::get_local(&*conn);
|
||||||
|
Json(json!({
|
||||||
|
"name": &instance.name,
|
||||||
|
"description": &instance.short_description,
|
||||||
|
"start_url": String::from("/"),
|
||||||
|
"scope": String::from("/"),
|
||||||
|
"display": String::from("standalone"),
|
||||||
|
"background_color": String::from("#f4f4f4"),
|
||||||
|
"theme_color": String::from("#7765e3")
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<link rel="stylesheet" href="/static/css/main.css" />
|
<link rel="stylesheet" href="/static/css/main.css" />
|
||||||
<link rel="stylesheet" href="/static/css/feather.css" />
|
<link rel="stylesheet" href="/static/css/feather.css" />
|
||||||
|
<link rel="manifest" href="/manifest.json" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
|
|
Loading…
Reference in a new issue