From 857188392348cb07f3300d6c3db7302f7adfca88 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Wed, 22 Jun 2022 20:58:47 +0200 Subject: [PATCH] Mark the first chapter as "index", even if not the first book item --- src/renderer/html_handlebars/hbs_renderer.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/renderer/html_handlebars/hbs_renderer.rs b/src/renderer/html_handlebars/hbs_renderer.rs index 26f1432c..8aebbce8 100644 --- a/src/renderer/html_handlebars/hbs_renderer.rs +++ b/src/renderer/html_handlebars/hbs_renderer.rs @@ -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