Fix building blog with zero posts
This commit is contained in:
parent
f88c5b46fc
commit
246cbe6281
1 changed files with 4 additions and 1 deletions
|
@ -227,7 +227,10 @@ fn pageify_posts(
|
||||||
root_path: String,
|
root_path: String,
|
||||||
extra_header: Element(Nil),
|
extra_header: Element(Nil),
|
||||||
) {
|
) {
|
||||||
let posts = list.sized_chunk(posts, config.rendering.posts_per_page)
|
let posts = case posts {
|
||||||
|
[] -> [[]]
|
||||||
|
posts -> list.sized_chunk(posts, config.rendering.posts_per_page)
|
||||||
|
}
|
||||||
let total_pages = list.length(posts)
|
let total_pages = list.length(posts)
|
||||||
list.index_map(posts, fn(page_posts, index) {
|
list.index_map(posts, fn(page_posts, index) {
|
||||||
let page = index + 1
|
let page = index + 1
|
||||||
|
|
Loading…
Reference in a new issue