Compare commits
2 commits
9ebc0c9736
...
b320605f26
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b320605f26 | ||
![]() |
9dba0779eb |
5 changed files with 26 additions and 15 deletions
|
@ -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!();
|
||||
}
|
||||
|
||||
|
|
|
@ -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> {
|
||||
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<chrono_tz::Tz>)
|
|||
.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!()
|
||||
}
|
||||
|
||||
|
@ -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{}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -27,7 +27,8 @@ struct Event {
|
|||
_end_time: Option<String>,
|
||||
#[serde(alias = "eventName")]
|
||||
event_name: String,
|
||||
location: String,
|
||||
// Seen in test data where this can be missing
|
||||
location: Option<String>,
|
||||
#[serde(alias = "Id")]
|
||||
id: String,
|
||||
#[serde(alias = "startDate")]
|
||||
|
@ -95,7 +96,7 @@ impl Calendar {
|
|||
Some(Ok(EventInstance {
|
||||
calendar_ui: self.config.ui.clone(),
|
||||
dtstart,
|
||||
location: Some(ev.location.clone()),
|
||||
location: ev.location.clone(),
|
||||
recurrence_id: None,
|
||||
summary: Some(ev.event_name.clone()),
|
||||
uid: Some(ev.id.clone()),
|
||||
|
@ -111,9 +112,10 @@ impl Calendar {
|
|||
}
|
||||
|
||||
pub(crate) fn read_from_config(config: Config) -> Result<Self> {
|
||||
let path = &config.dl.file_path;
|
||||
let s = std::fs::read_to_string(path).with_context(|| format!("Couldn't read {path:?}"))?;
|
||||
Self::read_from_str(config, &s)
|
||||
let path = config.dl.file_path.clone();
|
||||
let s =
|
||||
std::fs::read_to_string(&path).with_context(|| format!("Couldn't read {path:?}"))?;
|
||||
Self::read_from_str(config, &s).with_context(|| format!("Couldn't parse {path:?}"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,9 +95,10 @@ impl Calendar {
|
|||
}
|
||||
|
||||
pub(crate) fn read_from_config(config: Config) -> Result<Self> {
|
||||
let path = &config.dl.file_path;
|
||||
let s = std::fs::read_to_string(path).with_context(|| format!("Couldn't read {path:?}"))?;
|
||||
Self::read_from_str(config, &s)
|
||||
let path = config.dl.file_path.clone();
|
||||
let s =
|
||||
std::fs::read_to_string(&path).with_context(|| format!("Couldn't read {path:?}"))?;
|
||||
Self::read_from_str(config, &s).with_context(|| format!("Couldn't parse {path:?}"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -267,8 +267,9 @@ impl Calendar {
|
|||
}
|
||||
|
||||
pub(crate) fn read_from_config(config: Config) -> Result<Self> {
|
||||
let path = &config.dl.file_path;
|
||||
let s = std::fs::read_to_string(path).with_context(|| format!("Couldn't read {path:?}"))?;
|
||||
Self::read_from_str(config, &s)
|
||||
let path = config.dl.file_path.clone();
|
||||
let s =
|
||||
std::fs::read_to_string(&path).with_context(|| format!("Couldn't read {path:?}"))?;
|
||||
Self::read_from_str(config, &s).with_context(|| format!("Couldn't parse {path:?}"))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue