diff options
| author | 2026-01-01 21:34:04 +0100 | |
|---|---|---|
| committer | 2026-01-01 21:34:04 +0100 | |
| commit | 7c14130b61d806b42e7c0d1c8cf846b964caadff (patch) | |
| tree | 911525b06dfa96b5902e5b765e9e7c842cf6b909 /src | |
| parent | c65bc67e161e5bb4a5bf153476d0252c165ad6ce (diff) | |
| download | blossom-7c14130b61d806b42e7c0d1c8cf846b964caadff.tar.gz blossom-7c14130b61d806b42e7c0d1c8cf846b964caadff.tar.bz2 blossom-7c14130b61d806b42e7c0d1c8cf846b964caadff.zip | |
about page
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 9 | ||||
| -rw-r--r-- | src/templates.rs | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 7253a16..0f14e3c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -160,6 +160,14 @@ async fn contact(locale: Locale) -> templates::Contact { } #[handler] +async fn about(locale: Locale) -> templates::About { + templates::About { + title: locale.text("title-about").unwrap(), + locale, + } +} + +#[handler] async fn plants() -> Result<()> { Err(BlossomError::Unimplemented) } @@ -229,6 +237,7 @@ async fn main() -> std::result::Result<(), std::io::Error> { .at("/poetry/:poem", get(get_poem)) .at("/feed", get(feed)) .at("/contact", get(contact)) + .at("/about", get(about)) .at("/plants", get(plants)) .nest("/static/", EmbeddedFilesEndpoint::<Static>::new()) .catch_all_error(custom_error) diff --git a/src/templates.rs b/src/templates.rs index 66462eb..b4ea98d 100644 --- a/src/templates.rs +++ b/src/templates.rs @@ -29,6 +29,13 @@ pub struct Home { } #[derive(Template)] +#[template(path = "about.html")] +pub struct About { + pub title: String, + pub locale: Locale, +} + +#[derive(Template)] #[template(path = "blogpost.html")] pub struct Blogpost { pub title: String, |
