diff --git a/src/router.rs b/src/router.rs index 6c714e2..6dcf7cf 100644 --- a/src/router.rs +++ b/src/router.rs @@ -25,6 +25,7 @@ pub async fn router(with_watchers: bool) -> Result<(Router, Vec) -> Result> { .await?, )) } +async fn about(State(state): State) -> Result> { + Ok(Html( + state + .templates + .render("pages/about.html.jinja", context!()) + .await?, + )) +} diff --git a/src/templates/page.html.jinja b/src/templates/page.html.jinja index c57df17..b6c5398 100644 --- a/src/templates/page.html.jinja +++ b/src/templates/page.html.jinja @@ -2,12 +2,15 @@ + Sup - + Page Template +Index +About {% block body %}{% endblock %} diff --git a/src/templates/pages/about.html.jinja b/src/templates/pages/about.html.jinja new file mode 100644 index 0000000..d2a466a --- /dev/null +++ b/src/templates/pages/about.html.jinja @@ -0,0 +1,7 @@ +{% extends "page.html.jinja" %} +{% block body %} +

About

+

+ Welcome to my awesome about page! +

+{% endblock %} diff --git a/src/templates/pages/index.html.jinja b/src/templates/pages/index.html.jinja index 796b34b..9d89bcf 100644 --- a/src/templates/pages/index.html.jinja +++ b/src/templates/pages/index.html.jinja @@ -2,6 +2,6 @@ {% block body %}

Index

- Welcome to my awesome homepage! + Welcome to my awesome index!

{% endblock %}