diff --git a/src/main.rs b/src/main.rs index 8a833b4..12688de 100644 --- a/src/main.rs +++ b/src/main.rs @@ -346,6 +346,7 @@ fn main_debug_rss(cli: CliDebugRss) -> Result<()> { println!("{}", item.channel_title); println!("{}", item.inner.title.as_ref().unwrap()); println!("{}", item.date.to_rfc3339()); + println!("{}", item.inner.link.as_ref().unwrap()); println!(); } diff --git a/src/output.rs b/src/output.rs index b7dd4f6..61fb772 100644 --- a/src/output.rs +++ b/src/output.rs @@ -58,6 +58,14 @@ impl Config { } } +fn day_link(date: chrono::NaiveDate) -> maud::PreEscaped { + 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 { if let Some(html_url) = &calendar_ui.html_url { maud::html! { a href=(html_url) { (calendar_ui.short_name) } } @@ -110,7 +118,7 @@ fn calendars_page(upstreams: &[crate::CalendarUi], now: DateTime) .into_string() } -pub(crate) fn feed_page(feed_items: &[crate::FeedItem], now: DateTime) -> String { +pub(crate) fn feed_page(_feed_items: &[crate::FeedItem], _now: DateTime) -> String { todo!() } @@ -162,10 +170,8 @@ fn index_page( p class="past"{ s { (date.format("%-d %A")) } } }); } else { - let date_s = date.format("%-d %A"); - let id = date.format("%F"); html_list.push(maud::html! { - h3 id=(id) { (date_s) " " a href=(format!("#{id}")) title=(format!("Permalink to {date_s}")) {"🔗"} } + (day_link(date)) hr{} }); }