begin building tuts list logic
This commit is contained in:
parent
f927091148
commit
bc57c6bf1b
@ -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<impl IntoResponse, ApiError> {
|
||||
@ -29,7 +31,7 @@ pub async fn tuts_builder(path: String) -> Result<impl IntoResponse, ApiError> {
|
||||
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()
|
||||
|
@ -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")]
|
||||
|
@ -7,5 +7,6 @@ content %}
|
||||
</nav>
|
||||
|
||||
<h1>Notes</h1>
|
||||
<p>Here all my Micro Tuts go</p>
|
||||
<p>Here all my Micro Tuts</p>
|
||||
{{tuts_list}}
|
||||
{% endblock content%}
|
||||
|
Loading…
Reference in New Issue
Block a user