blob: ca8c9b37064c5d719cf42ef8c479dfef39d49cc6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
//! Overview page
//!
//! This is the first page a user sees when they just go to the site
//! root. It renders the `README`, or `README.md` file from the modo
//! repo root, to provide users with a starting point.
use crate::templ_data::{overview::Index, BaseData};
use actix_web::{web, HttpRequest, HttpResponse, Result};
use askama::Template;
pub async fn render(req: HttpRequest) -> Result<HttpResponse> {
let readme: String = markdown::to_html(include_str!("../../fake-readme.md").into());
let index = Index {
base: BaseData {
sitename: "dev.spacekookie.de".into(),
..BaseData::default()
},
readme,
}
.render()
.unwrap();
Ok(HttpResponse::Ok().content_type("text/html").body(index))
}
|