Skip to content

Commit

Permalink
pedantic
Browse files Browse the repository at this point in the history
  • Loading branch information
rochacbruno committed Oct 29, 2024
1 parent d606e6d commit 0b89c4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/marmite.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ menu:
- ['Docs', 'tag-docs.html']
- ['Contributors', 'contributors.html']
- ['Tags', 'tags.html']
- ['Archive', 'archive.html']
- ['Github', 'https://github.com/rochacbruno/marmite/']
extra:
comments:
Expand Down
14 changes: 4 additions & 10 deletions src/site.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,29 +583,23 @@ fn handle_archive_pages(
let mut unique_years: Vec<(String, usize)> = Vec::new();
let mut grouped_posts: HashMap<String, Vec<Content>> = HashMap::new();
let posts = site_data.posts.clone();
for post in posts.into_iter() {
for post in posts {
if let Some(date) = post.date {
let year = date.year().to_string();
grouped_posts
.entry(year)
.or_default()
.push(post);
grouped_posts.entry(year).or_default().push(post);
}
}

// render each year page
for (year, contents) in &grouped_posts {
handle_list_page(
global_context,
&site_data
.site
.archives_content_title
.replace("$year", year),
&site_data.site.archives_content_title.replace("$year", year),
contents,
site_data,
tera,
output_dir,
format!("archive-{}", year).as_ref(),
format!("archive-{year}").as_ref(),
)?;
unique_years.push((year.to_owned(), contents.len()));
}
Expand Down

0 comments on commit 0b89c4d

Please sign in to comment.