Skip to content

Commit

Permalink
fix(jsonfeed): Populate with tags, if present
Browse files Browse the repository at this point in the history
This was reported in cobalt-org#1137
  • Loading branch information
epage committed Jun 1, 2023
1 parent bd4ffca commit 9401975
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,18 @@ impl Document {
self.description_to_str().unwrap_or_else(|| "".into()),
),
date_published: self.front.published_date.map(|date| date.to_rfc2822()),
// TODO completely implement categories, see Issue 131
tags: Some(
self.front
.categories
.iter()
.map(|s| s.as_str().to_owned())
.collect(),
.tags
.as_ref()
.map(|tags| tags.iter().map(|s| s.as_str().to_owned()).collect())
.unwrap_or_else(|| {
self.front
.categories
.iter()
.map(|s| s.as_str().to_owned())
.collect()
}),
),
..Default::default()
}
Expand Down

0 comments on commit 9401975

Please sign in to comment.