This commit is contained in:
parent
16b9427612
commit
ec90edfc3d
2 changed files with 4 additions and 0 deletions
|
@ -13,6 +13,7 @@ pub async fn page(req: HttpRequest, config: web::Data<Config>) -> impl Responder
|
||||||
|
|
||||||
#[once(time = 60)]
|
#[once(time = 60)]
|
||||||
pub fn build_page(config: Config, url: String) -> String {
|
pub fn build_page(config: Config, url: String) -> String {
|
||||||
|
println!("{url}");
|
||||||
config.tmpl.render(
|
config.tmpl.render(
|
||||||
"index.html",
|
"index.html",
|
||||||
(),
|
(),
|
||||||
|
|
|
@ -33,6 +33,8 @@ struct Data<T> {
|
||||||
page_desc: Option<String>,
|
page_desc: Option<String>,
|
||||||
/// Keywords of the the page
|
/// Keywords of the the page
|
||||||
page_kw: Option<String>,
|
page_kw: Option<String>,
|
||||||
|
/// App URL
|
||||||
|
url: String,
|
||||||
/// Data needed to render the page
|
/// Data needed to render the page
|
||||||
data: T,
|
data: T,
|
||||||
}
|
}
|
||||||
|
@ -47,6 +49,7 @@ impl Template {
|
||||||
page_title: info.page_title,
|
page_title: info.page_title,
|
||||||
page_desc: info.page_desc,
|
page_desc: info.page_desc,
|
||||||
page_kw: info.page_kw,
|
page_kw: info.page_kw,
|
||||||
|
url: info.url,
|
||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue