diff --git a/Cargo.toml b/Cargo.toml index 1f71f94..e2948c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,4 +13,5 @@ keywords = ["website"] [dependencies] rocket = "0.5.0" +rocket_dyn_templates = { version = "0.1.0", features = ["tera"] } diff --git a/src/main.rs b/src/main.rs index 3bebfc5..b2a95c1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,12 @@ use rocket::{get,launch,routes}; +use rocket_dyn_templates::{context, Template}; #[get("/")] -fn index() -> &'static str { - "Hello, world!" +fn index() -> Template { + Template::render("index", context! {}) } #[launch] fn entrypoint() -> _ { - rocket::build().mount("/", routes![index]) + rocket::build().mount("/", routes![index]).attach(Template::fairing()) } diff --git a/templates/base.html.tera b/templates/base.html.tera new file mode 100644 index 0000000..047495d --- /dev/null +++ b/templates/base.html.tera @@ -0,0 +1,164 @@ + + + + + + + + + + {% block head %} + {% block title %}{% endblock title %} - cscherr.de + {% endblock head %} + + +
+
+ + + Simple header + +
+
+
+ {% block main %} +
+ +

Centered hero

+
+

Quickly design and customize responsive mobile-first sites with Bootstrap, the world’s most popular front-end open source toolkit, featuring Sass variables and mixins, responsive grid system, extensive prebuilt components, and powerful JavaScript plugins.

+
+ + +
+
+
+
+

Hanging icons

+
+
+
+ +
+
+

Featured title

+

Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.

+ + Primary button + +
+
+
+
+ +
+
+

Featured title

+

Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.

+ + Primary button + +
+
+
+
+ +
+
+

Featured title

+

Paragraph of text beneath the heading to explain the heading. We'll add onto it with another sentence and probably just keep going until we run out of words.

+ + Primary button + +
+
+
+
+ {% endblock main %} +
+
+ +
+ + + diff --git a/templates/index.html.tera b/templates/index.html.tera new file mode 100644 index 0000000..5aedbbc --- /dev/null +++ b/templates/index.html.tera @@ -0,0 +1 @@ +{% extends "base" %}