wip: struggling with the feed page a bit

This commit is contained in:
_ 2025-09-11 03:25:58 +00:00
parent 9ebc0c9736
commit 9dba0779eb
2 changed files with 11 additions and 4 deletions

View file

@ -346,6 +346,7 @@ fn main_debug_rss(cli: CliDebugRss) -> Result<()> {
println!("{}", item.channel_title); println!("{}", item.channel_title);
println!("{}", item.inner.title.as_ref().unwrap()); println!("{}", item.inner.title.as_ref().unwrap());
println!("{}", item.date.to_rfc3339()); println!("{}", item.date.to_rfc3339());
println!("{}", item.inner.link.as_ref().unwrap());
println!(); println!();
} }

View file

@ -58,6 +58,14 @@ impl Config {
} }
} }
fn day_link(date: chrono::NaiveDate) -> maud::PreEscaped<String> {
let date_s = date.format("%-d %A");
let id = date.format("%F");
maud::html! {
h3 id=(id) { (date_s) " " a href=(format!("#{id}")) title=(format!("Permalink to {date_s}")) {"🔗"} }
}
}
fn calendar_link(calendar_ui: &crate::CalendarUi) -> maud::PreEscaped<String> { fn calendar_link(calendar_ui: &crate::CalendarUi) -> maud::PreEscaped<String> {
if let Some(html_url) = &calendar_ui.html_url { if let Some(html_url) = &calendar_ui.html_url {
maud::html! { a href=(html_url) { (calendar_ui.short_name) } } maud::html! { a href=(html_url) { (calendar_ui.short_name) } }
@ -110,7 +118,7 @@ fn calendars_page(upstreams: &[crate::CalendarUi], now: DateTime<chrono_tz::Tz>)
.into_string() .into_string()
} }
pub(crate) fn feed_page(feed_items: &[crate::FeedItem], now: DateTime<chrono_tz::Tz>) -> String { pub(crate) fn feed_page(_feed_items: &[crate::FeedItem], _now: DateTime<chrono_tz::Tz>) -> String {
todo!() todo!()
} }
@ -162,10 +170,8 @@ fn index_page(
p class="past"{ s { (date.format("%-d %A")) } } p class="past"{ s { (date.format("%-d %A")) } }
}); });
} else { } else {
let date_s = date.format("%-d %A");
let id = date.format("%F");
html_list.push(maud::html! { html_list.push(maud::html! {
h3 id=(id) { (date_s) " " a href=(format!("#{id}")) title=(format!("Permalink to {date_s}")) {"🔗"} } (day_link(date))
hr{} hr{}
}); });
} }