don't filter away posts when getting tags
This commit is contained in:
parent
ba465f4bde
commit
50b84a0025
1 changed files with 1 additions and 1 deletions
|
@ -14,7 +14,7 @@ pub struct Tag {
|
||||||
pub fn get_tags<'a>(posts: impl IntoIterator<Item=&'a Post>) -> HashMap<String,Tag> {
|
pub fn get_tags<'a>(posts: impl IntoIterator<Item=&'a Post>) -> HashMap<String,Tag> {
|
||||||
let mut tags: HashMap<String,Tag> = HashMap::new();
|
let mut tags: HashMap<String,Tag> = HashMap::new();
|
||||||
|
|
||||||
for post in posts.into_iter().filter(|p| p.is_published()) {
|
for post in posts.into_iter() {
|
||||||
for key in &post.tags {
|
for key in &post.tags {
|
||||||
if let Some(tag) = tags.get_mut(key) {
|
if let Some(tag) = tags.get_mut(key) {
|
||||||
tag.posts.push(post.slug.clone());
|
tag.posts.push(post.slug.clone());
|
||||||
|
|
Loading…
Reference in a new issue