diff options
author | Vika <vika@fireburn.ru> | 2023-06-22 20:28:21 +0300 |
---|---|---|
committer | Vika <vika@fireburn.ru> | 2023-06-22 20:28:21 +0300 |
commit | d61e1f6a8e5ad5b7c14b1f9ab3101496f3f9ea00 (patch) | |
tree | a8db5c905061fd25b19825a4d8aee890dd7c62b2 /kittybox-rs/templates/src | |
parent | ff358723da641af9f4ae1f742eb1b382f4630220 (diff) | |
download | kittybox-d61e1f6a8e5ad5b7c14b1f9ab3101496f3f9ea00.tar.zst |
database: introduce read_feed_with_cursor
read_feed_with_cursor allows using an arbitrary string as a cursor, unlike read_feed_with_limit, which uses last post's UID as a cursor.
Diffstat (limited to 'kittybox-rs/templates/src')
-rw-r--r-- | kittybox-rs/templates/src/mf2.rs | 4 | ||||
-rw-r--r-- | kittybox-rs/templates/src/templates.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/kittybox-rs/templates/src/mf2.rs b/kittybox-rs/templates/src/mf2.rs index 0e03dc6..7f943d3 100644 --- a/kittybox-rs/templates/src/mf2.rs +++ b/kittybox-rs/templates/src/mf2.rs @@ -344,7 +344,7 @@ markup::define! { @PhotoGallery { photos: food["properties"]["photo"].as_array() } } } - Feed<'a>(feed: &'a serde_json::Value) { + Feed<'a>(feed: &'a serde_json::Value, cursor: Option<&'a str>) { div."h-feed" { div.metadata { @if feed["properties"]["name"][0].is_string() { @@ -359,7 +359,7 @@ markup::define! { @for child in feed["children"].as_array().unwrap() { @match child["type"][0].as_str().unwrap() { "h-entry" => { @Entry { post: child } } - "h-feed" => { @Feed { feed: child } } + "h-feed" => { @Feed { feed: child, cursor: None } } "h-food" => { @Food { food: child } } //"h-event" => { } "h-card" => { @VCard { card: child } } diff --git a/kittybox-rs/templates/src/templates.rs b/kittybox-rs/templates/src/templates.rs index 9826bfc..288669d 100644 --- a/kittybox-rs/templates/src/templates.rs +++ b/kittybox-rs/templates/src/templates.rs @@ -63,7 +63,7 @@ markup::define! { } } } - MainPage<'a>(feed: &'a serde_json::Value, card: &'a serde_json::Value, webring: bool) { + MainPage<'a>(feed: &'a serde_json::Value, card: &'a serde_json::Value, cursor: Option<&'a str>, webring: bool) { .sidebyside { @VCard { card } #dynamicstuff { @@ -90,7 +90,7 @@ markup::define! { } } } - @Feed { feed } + @Feed { feed, cursor: *cursor } } ErrorPage(code: StatusCode, msg: Option<String>) { h1 { @format!("HTTP {code}") } |