Mark the first chapter as "index", even if not the first book item
This commit is contained in:
parent
4cf005d4bd
commit
8571883923
|
@ -540,7 +540,8 @@ impl Renderer for HtmlHandlebars {
|
||||||
chapter_titles: &ctx.chapter_titles,
|
chapter_titles: &ctx.chapter_titles,
|
||||||
};
|
};
|
||||||
self.render_item(item, ctx, &mut print_content)?;
|
self.render_item(item, ctx, &mut print_content)?;
|
||||||
is_index = false;
|
// Only the first non-draft chapter item should be treated as the "index"
|
||||||
|
is_index &= !matches!(item, BookItem::Chapter(ch) if !ch.is_draft_chapter());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render 404 page
|
// Render 404 page
|
||||||
|
|
Loading…
Reference in New Issue