From f06819cff139562581acfb10715b6176b567ab92 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sun, 18 Apr 2021 10:40:03 -0400 Subject: Revert "backpost a bunch of other articles, make linkposts work properly" This reverts commit 4dde8b26b8be9d9c11bb3920c942ecd6624e419e. --- src/post/mod.rs | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/post/mod.rs b/src/post/mod.rs index 2b1b7e2..b5303a8 100644 --- a/src/post/mod.rs +++ b/src/post/mod.rs @@ -20,8 +20,8 @@ impl Into for Post { let mut result = jsonfeed::Item::builder() .title(self.front_matter.title) .content_html(self.body_html) - .id(self.link.clone()) - .url(self.link) + .id(format!("https://christine.website/{}", self.link)) + .url(format!("https://christine.website/{}", self.link)) .date_published(self.date.to_rfc3339()) .author( jsonfeed::Author::new() @@ -30,10 +30,6 @@ impl Into for Post { .avatar("https://christine.website/static/img/avatar.png"), ); - if let Some(url) = self.front_matter.redirect_to { - result = result.url(url); - } - let mut tags: Vec = vec![]; if let Some(series) = self.front_matter.series { @@ -83,16 +79,7 @@ async fn read_post(dir: &str, fname: PathBuf) -> Result { let body = &body[content_offset..]; let date = NaiveDate::parse_from_str(&front_matter.clone().date, "%Y-%m-%d") .map_err(|why| eyre!("error parsing date in {:?}: {}", fname, why))?; - - let link = match front_matter.redirect_to { - Some(ref url) => url.clone(), - None => format!( - "https://christine.website/{}/{}", - dir, - fname.file_stem().unwrap().to_str().unwrap() - ), - }; - + let link = format!("{}/{}", dir, fname.file_stem().unwrap().to_str().unwrap()); let body_html = crate::app::markdown::render(&body) .wrap_err_with(|| format!("can't parse markdown for {:?}", fname))?; let date: DateTime = -- cgit v1.2.3