mirror of
https://github.com/YGGverse/btracker-gemini.git
synced 2026-03-31 09:05:30 +00:00
implement semantic titles for search and pagination requests
This commit is contained in:
parent
fbb15ed8e7
commit
164e562acd
1 changed files with 17 additions and 1 deletions
18
src/main.rs
18
src/main.rs
|
|
@ -319,7 +319,23 @@ fn list(state: &State, keyword: Option<&str>, page: Option<usize>) -> Result<Str
|
|||
|
||||
let mut b = Vec::new();
|
||||
|
||||
b.push(format!("# {}\n", state.name));
|
||||
b.push(format!("# {}\n", {
|
||||
let mut h = String::new();
|
||||
|
||||
if let Some(k) = keyword {
|
||||
h.push_str(k);
|
||||
h.push_str(" • ");
|
||||
}
|
||||
|
||||
if let Some(p) = page
|
||||
&& p > 1
|
||||
{
|
||||
h.push_str(&format!("Page {p} • "));
|
||||
}
|
||||
|
||||
h.push_str(&state.name);
|
||||
h
|
||||
}));
|
||||
|
||||
if let Some(ref description) = state.description {
|
||||
b.push(format!("{description}\n"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue