Mark the first chapter as "index", even if not the first book item

This commit is contained in:
ISSOtm 2022-06-22 20:58:47 +02:00
parent 4cf005d4bd
commit 8571883923
1 changed files with 2 additions and 1 deletions

View File

@ -540,7 +540,8 @@ impl Renderer for HtmlHandlebars {
chapter_titles: &ctx.chapter_titles,
};
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