Skip to content

Commit

Permalink
Mark the redirect articles coming from redirect file as front articles.
Browse files Browse the repository at this point in the history
This way, they are correctly title indexed.
  • Loading branch information
mgautierfr committed Dec 4, 2023
1 parent 8d143f4 commit 8c3bff7
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/zimwriterfs/zimcreatorfs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Check warning on line 78 in src/zimwriterfs/zimcreatorfs.cpp

View check run for this annotation

Codecov / codecov/patch

src/zimwriterfs/zimcreatorfs.cpp#L78

Added line #L78 was not covered by tests
this->addRedirection(
redirect.path,
redirect.title,

Check warning on line 81 in src/zimwriterfs/zimcreatorfs.cpp

View check run for this annotation

Codecov / codecov/patch

src/zimwriterfs/zimcreatorfs.cpp#L80-L81

Added lines #L80 - L81 were not covered by tests
redirect.target,
{{zim::writer::HintKeys::FRONT_ARTICLE, 1}}
);
}

Check warning on line 85 in src/zimwriterfs/zimcreatorfs.cpp

View check run for this annotation

Codecov / codecov/patch

src/zimwriterfs/zimcreatorfs.cpp#L85

Added line #L85 was not covered by tests
);
} catch(const std::runtime_error& e) {
std::cerr << e.what() << "\nin redirect file " << path << std::endl;
in_stream.close();
Expand Down

0 comments on commit 8c3bff7

Please sign in to comment.