Remove next/previous page when adding a previous/next to avoid chains
Where all the posts would be serialized
This commit is contained in:
parent
dbe4a1d517
commit
efb4d16ede
|
@ -59,12 +59,20 @@ pub fn populate_previous_and_next_pages(input: &[Page]) -> Vec<Page> {
|
|||
|
||||
if i > 0 {
|
||||
let next = &pages[i - 1];
|
||||
new_page.next = Some(Box::new(next.clone()));
|
||||
let mut next_page = next.clone();
|
||||
// Remove prev/next otherwise we serialise the whole thing...
|
||||
next_page.previous = None;
|
||||
next_page.next = None;
|
||||
new_page.next = Some(Box::new(next_page));
|
||||
}
|
||||
|
||||
if i < input.len() - 1 {
|
||||
let previous = &pages[i + 1];
|
||||
new_page.previous = Some(Box::new(previous.clone()));
|
||||
// Remove prev/next otherwise we serialise the whole thing...
|
||||
let mut previous_page = previous.clone();
|
||||
previous_page.previous = None;
|
||||
previous_page.next = None;
|
||||
new_page.previous = Some(Box::new(previous_page));
|
||||
}
|
||||
res.push(new_page);
|
||||
}
|
||||
|
|
|
@ -316,7 +316,6 @@ impl Site {
|
|||
create_directory(¤t_path)?;
|
||||
}
|
||||
}
|
||||
println!("Rendering page");
|
||||
|
||||
// Make sure the folder exists
|
||||
create_directory(¤t_path)?;
|
||||
|
|
Loading…
Reference in a new issue