");
- for card in matches {
+ for card in &matches {
write!(
body,
- r#"
{card}"#,
+ r#"
{card}"#,
card.id,
+ card.name,
IMG_HOST.as_str(),
card.id
)?;
}
body.push_str("
");
- Ok(PageData { title: readable_query.clone(), query: Some(raw_query), body })
+ Ok(PageData {
+ description: readable_query,
+ query: Some(raw_query),
+ body,
+ title: format!("{} results - YGO Card Database", matches.len()),
+ })
}
fn add_data(res: &mut String, pd: &PageData) -> AnyResult<()> {
- res.push_str(&HEADER.replacen("{TITLE}", &pd.title, 1).replacen("{IMG_HOST}", &IMG_HOST, 1));
+ res.push_str(
+ &HEADER.replacen("{DESCRIPTION}", &pd.description, 2).replacen("{IMG_HOST}", &IMG_HOST, 1).replacen("{TITLE}", &pd.title, 2),
+ );
add_searchbox(res, &pd.query)?;
res.push_str(&pd.body);
res.push_str(FOOTER);
diff --git a/static/header.html b/static/header.html
index 920a68d..3b6de3a 100644
--- a/static/header.html
+++ b/static/header.html
@@ -1,6 +1,10 @@
-
+
-