updated templates
This commit is contained in:
parent
a89443a4c8
commit
755e057fd6
3 changed files with 82 additions and 17 deletions
10
src/main.rs
10
src/main.rs
|
@ -91,7 +91,15 @@ fn hop(data: Data<Arc<State>>, query: Query<SearchQuery>) -> impl Responder {
|
||||||
|
|
||||||
#[get("/")]
|
#[get("/")]
|
||||||
fn index(data: Data<Arc<State>>) -> impl Responder {
|
fn index(data: Data<Arc<State>>) -> impl Responder {
|
||||||
HttpResponse::Ok().body(data.renderer.read().unwrap().render("index", &()).unwrap())
|
let mut template_args = HashMap::new();
|
||||||
|
template_args.insert("hostname", &data.public_address);
|
||||||
|
HttpResponse::Ok().body(
|
||||||
|
data.renderer
|
||||||
|
.read()
|
||||||
|
.unwrap()
|
||||||
|
.render("index", &template_args)
|
||||||
|
.unwrap(),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[get("/bunbunsearch.xml")]
|
#[get("/bunbunsearch.xml")]
|
||||||
|
|
|
@ -1,12 +1,52 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<title>Bunbun</title>
|
||||||
|
<style type="text/css">
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
background-color: #212121;
|
||||||
|
color: #fff;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||||
|
}
|
||||||
|
h1, p { margin: 0; }
|
||||||
|
main { display: flex; }
|
||||||
|
a { color: white; }
|
||||||
|
</style>
|
||||||
<link rel="search"
|
<link rel="search"
|
||||||
type="application/opensearchdescription+xml"
|
type="application/opensearchdescription+xml"
|
||||||
title="bunbun"
|
title="bunbun"
|
||||||
href="bunbunsearch.xml">
|
href="bunbunsearch.xml">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
hello world
|
<h1>Bunbun</h1>
|
||||||
|
<p>Thanks for installing bunbun! To setup bunbun for your web browser, follow these steps:</p>
|
||||||
|
<main>
|
||||||
|
<section>
|
||||||
|
<h2>Firefox</h2>
|
||||||
|
<ol>
|
||||||
|
<li>
|
||||||
|
Click the following button:
|
||||||
|
<button onclick="window.external.AddSearchProvider('http://{{hostname}}/bunbunsearch.xml')">
|
||||||
|
Add search engine
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
<li>Type in "about:preferences#search" in the address bar and hit Enter.</li>
|
||||||
|
<li>Set your default search engine to bunbun.</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
<section>
|
||||||
|
<h2>Chrome</h2>
|
||||||
|
<ol>
|
||||||
|
<li>Type in "chrome://settings/search" in the address bar and hit Enter.</li>
|
||||||
|
<li>Select "Manage search engines"</li>
|
||||||
|
<li>Search for "bunbun"</li>
|
||||||
|
<li>Select the three dots on the bunbun entry, and select "Make default"</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
<p>To view a full list of commands, check out the <a href="/ls">command list</a>.</p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,14 +1,31 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<head>
|
||||||
|
<title>Bunbun Command List</title>
|
||||||
|
<style type="text/css">
|
||||||
|
body {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
background-color: #212121;
|
||||||
|
color: #fff;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||||
|
}
|
||||||
|
h1, p { margin: 0; }
|
||||||
|
table { margin-top: 1em; }
|
||||||
|
td, th { padding: 0 0.5em; }
|
||||||
|
.shortcut { text-align: right; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Bunbun Command List</h1>
|
||||||
|
<p><em>To edit this list, edit your <code>bunbun.toml</code> file.</em></p>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Shortcut</th>
|
<th>Shortcut</th>
|
||||||
<th>Target</th>
|
<th>Target</th>
|
||||||
</tr>
|
</tr>
|
||||||
{{#each this}}
|
{{#each this}}<tr><td class="shortcut">{{@key}}</td><td class="target">{{this}}</td></tr>{{/each}}
|
||||||
<tr><td>{{@key}}</td><td>{{this}}</td></tr>
|
|
||||||
{{/each}}
|
|
||||||
</table>
|
</table>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue