From 755e057fd616d6ceecd4d9f09c050db6db3ef701 Mon Sep 17 00:00:00 2001 From: Edward Shen Date: Sun, 15 Dec 2019 18:26:29 -0500 Subject: [PATCH] updated templates --- src/main.rs | 10 ++++++++- src/templates/index.hbs | 50 ++++++++++++++++++++++++++++++++++++----- src/templates/list.hbs | 39 +++++++++++++++++++++++--------- 3 files changed, 82 insertions(+), 17 deletions(-) diff --git a/src/main.rs b/src/main.rs index f6f89e7..f6cc53d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -91,7 +91,15 @@ fn hop(data: Data>, query: Query) -> impl Responder { #[get("/")] fn index(data: Data>) -> 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")] diff --git a/src/templates/index.hbs b/src/templates/index.hbs index db9730d..8e68ae7 100644 --- a/src/templates/index.hbs +++ b/src/templates/index.hbs @@ -1,12 +1,52 @@ - + Bunbun + + - hello world +

Bunbun

+

Thanks for installing bunbun! To setup bunbun for your web browser, follow these steps:

+
+
+

Firefox

+
    +
  1. + Click the following button: + +
  2. +
  3. Type in "about:preferences#search" in the address bar and hit Enter.
  4. +
  5. Set your default search engine to bunbun.
  6. +
+
+
+

Chrome

+
    +
  1. Type in "chrome://settings/search" in the address bar and hit Enter.
  2. +
  3. Select "Manage search engines"
  4. +
  5. Search for "bunbun"
  6. +
  7. Select the three dots on the bunbun entry, and select "Make default"
  8. +
+
+
+

To view a full list of commands, check out the command list.

diff --git a/src/templates/list.hbs b/src/templates/list.hbs index 7ae871f..5c82a22 100644 --- a/src/templates/list.hbs +++ b/src/templates/list.hbs @@ -1,14 +1,31 @@ - - - - - - - {{#each this}} - - {{/each}} -
ShortcutTarget
{{@key}}{{this}}
- + + Bunbun Command List + + + +

Bunbun Command List

+

To edit this list, edit your bunbun.toml file.

+ + + + + + {{#each this}}{{/each}} +
ShortcutTarget
{{@key}}{{this}}
+