|
|
@@ -628,10 +628,7 @@ impl Site { |
|
|
|
let mut context = Context::new(); |
|
|
|
context.insert("config", &self.config); |
|
|
|
let output = render_template("404.html", &self.tera, &context, &self.config.theme)?; |
|
|
|
create_file( |
|
|
|
&self.output_path.join("404.html"), |
|
|
|
&self.inject_livereload(output), |
|
|
|
) |
|
|
|
create_file(&self.output_path.join("404.html"), &self.inject_livereload(output)) |
|
|
|
} |
|
|
|
|
|
|
|
/// Renders robots.txt |
|
|
@@ -722,10 +719,15 @@ impl Site { |
|
|
|
.iter() |
|
|
|
.map(|s| SitemapEntry::new(s.permalink.clone(), None)) |
|
|
|
.collect::<Vec<_>>(); |
|
|
|
for section in self.library.sections_values().iter().filter(|s| s.meta.paginate_by.is_some()) { |
|
|
|
let number_pagers = (section.pages.len() as f64 / section.meta.paginate_by.unwrap() as f64).ceil() as isize; |
|
|
|
for i in 1..number_pagers+1 { |
|
|
|
let permalink = format!("{}{}/{}/", section.permalink, section.meta.paginate_path, i); |
|
|
|
for section in |
|
|
|
self.library.sections_values().iter().filter(|s| s.meta.paginate_by.is_some()) |
|
|
|
{ |
|
|
|
let number_pagers = (section.pages.len() as f64 |
|
|
|
/ section.meta.paginate_by.unwrap() as f64) |
|
|
|
.ceil() as isize; |
|
|
|
for i in 1..number_pagers + 1 { |
|
|
|
let permalink = |
|
|
|
format!("{}{}/{}/", section.permalink, section.meta.paginate_path, i); |
|
|
|
sections.push(SitemapEntry::new(permalink, None)) |
|
|
|
} |
|
|
|
} |
|
|
@@ -744,9 +746,17 @@ impl Site { |
|
|
|
)); |
|
|
|
|
|
|
|
if taxonomy.kind.is_paginated() { |
|
|
|
let number_pagers = (item.pages.len() as f64 / taxonomy.kind.paginate_by.unwrap() as f64).ceil() as isize; |
|
|
|
for i in 1..number_pagers+1 { |
|
|
|
let permalink = self.config.make_permalink(&format!("{}/{}/{}/{}", name, item.slug, taxonomy.kind.paginate_path(), i)); |
|
|
|
let number_pagers = (item.pages.len() as f64 |
|
|
|
/ taxonomy.kind.paginate_by.unwrap() as f64) |
|
|
|
.ceil() as isize; |
|
|
|
for i in 1..number_pagers + 1 { |
|
|
|
let permalink = self.config.make_permalink(&format!( |
|
|
|
"{}/{}/{}/{}", |
|
|
|
name, |
|
|
|
item.slug, |
|
|
|
taxonomy.kind.paginate_path(), |
|
|
|
i |
|
|
|
)); |
|
|
|
terms.push(SitemapEntry::new(permalink, None)) |
|
|
|
} |
|
|
|
} |
|
|
|