give url to templates
All checks were successful
ci/woodpecker/push/publish Pipeline was successful

This commit is contained in:
Mylloon 2023-04-29 14:13:22 +02:00
parent 16b9427612
commit ec90edfc3d
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 4 additions and 0 deletions

View file

@ -13,6 +13,7 @@ pub async fn page(req: HttpRequest, config: web::Data<Config>) -> impl Responder
#[once(time = 60)]
pub fn build_page(config: Config, url: String) -> String {
println!("{url}");
config.tmpl.render(
"index.html",
(),

View file

@ -33,6 +33,8 @@ struct Data<T> {
page_desc: Option<String>,
/// Keywords of the the page
page_kw: Option<String>,
/// App URL
url: String,
/// Data needed to render the page
data: T,
}
@ -47,6 +49,7 @@ impl Template {
page_title: info.page_title,
page_desc: info.page_desc,
page_kw: info.page_kw,
url: info.url,
data,
})
}