parent
19b4341957
commit
dc94aa219b
|
@ -35,6 +35,7 @@ sections up to the index to be used with the `get_section` Tera function
|
||||||
- Do not have a trailing slash for the RSS permalinks
|
- Do not have a trailing slash for the RSS permalinks
|
||||||
- `serve` will now try to find other ports than 1111 rather than panicking
|
- `serve` will now try to find other ports than 1111 rather than panicking
|
||||||
- Ensure content directory exists before rendering aliases
|
- Ensure content directory exists before rendering aliases
|
||||||
|
- Do not include drafts in pagination
|
||||||
|
|
||||||
## 0.4.2 (2018-09-03)
|
## 0.4.2 (2018-09-03)
|
||||||
|
|
||||||
|
|
|
@ -108,6 +108,9 @@ impl<'a> Paginator<'a> {
|
||||||
|
|
||||||
for key in self.all_pages {
|
for key in self.all_pages {
|
||||||
let page = library.get_page_by_key(*key);
|
let page = library.get_page_by_key(*key);
|
||||||
|
if page.is_draft() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
current_page.push(page.to_serialized_basic(library));
|
current_page.push(page.to_serialized_basic(library));
|
||||||
|
|
||||||
if current_page.len() == self.paginate_by {
|
if current_page.len() == self.paginate_by {
|
||||||
|
@ -242,6 +245,9 @@ mod tests {
|
||||||
library.insert_page(Page::default());
|
library.insert_page(Page::default());
|
||||||
library.insert_page(Page::default());
|
library.insert_page(Page::default());
|
||||||
library.insert_page(Page::default());
|
library.insert_page(Page::default());
|
||||||
|
let mut draft = Page::default();
|
||||||
|
draft.meta.draft = true;
|
||||||
|
library.insert_page(draft);
|
||||||
let mut section = create_section(is_index);
|
let mut section = create_section(is_index);
|
||||||
section.pages = library.pages().keys().collect();
|
section.pages = library.pages().keys().collect();
|
||||||
library.insert_section(section.clone());
|
library.insert_section(section.clone());
|
||||||
|
|
Loading…
Reference in a new issue