diff --git a/src/routes.rs b/src/routes.rs index 5783408..00f01e4 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -21,7 +21,9 @@ pub async fn notes() -> impl IntoResponse { } pub async fn tuts() -> impl IntoResponse { - templates::Tuts + templates::Tuts { + tuts_list: "some tuts", + } } pub async fn tuts_builder(path: String) -> Result { @@ -29,7 +31,7 @@ pub async fn tuts_builder(path: String) -> Result { let file_contents_to_html = markdown_to_html(file_contents.as_str(), &comrak::Options::default()); let file_template = Tut { - title: "test title", + title: "Note", content: file_contents_to_html.as_str(), }; let response = Response::builder() diff --git a/src/templates.rs b/src/templates.rs index 44c4ad3..71c6975 100644 --- a/src/templates.rs +++ b/src/templates.rs @@ -10,7 +10,9 @@ pub struct Notes; #[derive(Template)] #[template(path = "tuts.html")] -pub struct Tuts; +pub struct Tuts<'a> { + pub tuts_list: &'a str, +} #[derive(Template)] #[template(path = "tut.html", ext = "html", escape = "none")] diff --git a/templates/tuts.html b/templates/tuts.html index 608b21b..7013191 100644 --- a/templates/tuts.html +++ b/templates/tuts.html @@ -7,5 +7,6 @@ content %}

Notes

-

Here all my Micro Tuts go

+

Here all my Micro Tuts

+{{tuts_list}} {% endblock content%}