aboutsummaryrefslogtreecommitdiff
path: root/src/post
diff options
context:
space:
mode:
authorChristine Dodrill <me@christine.website>2021-04-18 10:40:03 -0400
committerChristine Dodrill <me@christine.website>2021-04-18 10:40:03 -0400
commitf06819cff139562581acfb10715b6176b567ab92 (patch)
tree5218de48c48b07735dc887b5bcb475f0ad26d9f7 /src/post
parente096c5bb00008cbae8cd680045d1831098844786 (diff)
downloadxesite-f06819cff139562581acfb10715b6176b567ab92.tar.xz
xesite-f06819cff139562581acfb10715b6176b567ab92.zip
Revert "backpost a bunch of other articles, make linkposts work properly"
This reverts commit 4dde8b26b8be9d9c11bb3920c942ecd6624e419e.
Diffstat (limited to 'src/post')
-rw-r--r--src/post/mod.rs19
1 files changed, 3 insertions, 16 deletions
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<jsonfeed::Item> 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<jsonfeed::Item> 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<String> = vec![];
if let Some(series) = self.front_matter.series {
@@ -83,16 +79,7 @@ async fn read_post(dir: &str, fname: PathBuf) -> Result<Post> {
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<FixedOffset> =