Compare commits

...

2 Commits

Author SHA1 Message Date
august kline d0a4b0f6a6 Update Cargo.lock 2025-01-09 12:06:01 -05:00
august kline 59a6205a1e RSS fixes 2025-01-09 12:05:42 -05:00
3 changed files with 24 additions and 11 deletions

12
Cargo.lock generated
View File

@ -693,9 +693,9 @@ dependencies = [
[[package]] [[package]]
name = "event-listener" name = "event-listener"
version = "5.3.1" version = "5.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae"
dependencies = [ dependencies = [
"concurrent-queue", "concurrent-queue",
"parking", "parking",
@ -1353,9 +1353,9 @@ dependencies = [
[[package]] [[package]]
name = "linux-raw-sys" name = "linux-raw-sys"
version = "0.4.14" version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
[[package]] [[package]]
name = "litemap" name = "litemap"
@ -2151,9 +2151,9 @@ dependencies = [
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "0.38.42" version = "0.38.43"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6"
dependencies = [ dependencies = [
"bitflags 2.6.0", "bitflags 2.6.0",
"errno", "errno",

View File

@ -828,7 +828,7 @@ pub(crate) async fn rss(db: &BlogDb) -> String {
} }
#[cfg(not(debug_assertions))] #[cfg(not(debug_assertions))]
{ {
["https://", env!("DOMAIN"), "/blog/", &entry.id].concat() ["https://", env!("DOMAIN"), "/blog/", &post.id].concat()
} }
}; };
let item = rewrite_str( let item = rewrite_str(
@ -856,9 +856,11 @@ pub(crate) async fn rss(db: &BlogDb) -> String {
.collect::<Vec<u32>>() .collect::<Vec<u32>>()
.try_into() .try_into()
.unwrap_or_default(); .unwrap_or_default();
let date_time: DateTime<Utc> = Utc let date_time: DateTime<FixedOffset> =
.with_ymd_and_hms(date[0] as i32, date[1], date[2], 0, 0, 0) FixedOffset::west_opt(5 * 3600) // New York City
.unwrap(); .unwrap()
.with_ymd_and_hms(date[0] as i32, date[1], date[2], 0, 0, 0)
.unwrap();
date_time.to_rfc2822() date_time.to_rfc2822()
}; };
pub_date.set_inner_content(&date, ContentType::Text); pub_date.set_inner_content(&date, ContentType::Text);

View File

@ -102,7 +102,18 @@ impl Block {
] ]
.concat(), .concat(),
Block::image { file, caption } => { Block::image { file, caption } => {
["<img src=\"", &file.url, "\" alt=\"", &caption.replace(r#"""#, "&quot;").replace("<br>", ""), "\"/>"].concat() let src = {
#[cfg(debug_assertions)]
{
&file.url
}
#[cfg(not(debug_assertions))]
{
&["https://", env!("DOMAIN"), &file.url].concat()
}
};
["<img src=\"", src, "\" alt=\"", &caption.replace(r#"""#, "&quot;").replace("<br>", ""), "\"/>"].concat()
} }
Block::delimiter {} => "<div style=\"inline-size: 100%; block-size: 1px; background: var(--color-text)\"></div>".to_string(), Block::delimiter {} => "<div style=\"inline-size: 100%; block-size: 1px; background: var(--color-text)\"></div>".to_string(),