From 8c3bff79190a81e740cd332bb8c3465878e1b1d3 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 4 Dec 2023 14:08:23 +0100 Subject: [PATCH] Mark the redirect articles coming from redirect file as front articles. This way, they are correctly title indexed. --- src/zimwriterfs/zimcreatorfs.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/zimwriterfs/zimcreatorfs.cpp b/src/zimwriterfs/zimcreatorfs.cpp index 0df0b031..c32868d5 100644 --- a/src/zimwriterfs/zimcreatorfs.cpp +++ b/src/zimwriterfs/zimcreatorfs.cpp @@ -74,7 +74,16 @@ void ZimCreatorFS::add_redirectArticles_from_file(const std::string& path) in_stream.open(path.c_str()); try { - parse_redirectArticles(in_stream, [this](Redirect redirect) {this->addRedirection(redirect.path, redirect.title, redirect.target);}); + parse_redirectArticles(in_stream, + [this](Redirect redirect) { + this->addRedirection( + redirect.path, + redirect.title, + redirect.target, + {{zim::writer::HintKeys::FRONT_ARTICLE, 1}} + ); + } + ); } catch(const std::runtime_error& e) { std::cerr << e.what() << "\nin redirect file " << path << std::endl; in_stream.close();