mirror of https://github.com/kiwix/libkiwix.git
Add links to content for tiles in /nojs
If the tiles are now clicked, they redirect to main page of book.
This commit is contained in:
parent
c1d7cc37fd
commit
dbded6eee2
|
@ -39,12 +39,17 @@ std::string HTMLDumper::dumpPlainHTML() const
|
|||
for ( const auto& bookId : library->getBooksIds() ) {
|
||||
const auto bookObj = library->getBookById(bookId);
|
||||
const auto bookTitle = bookObj.getTitle();
|
||||
std::string contentId = "";
|
||||
try {
|
||||
contentId = urlEncode(nameMapper->getNameForId(bookId));
|
||||
} catch (...) {}
|
||||
const auto bookDescription = bookObj.getDescription();
|
||||
const auto langCode = bookObj.getCommaSeparatedLanguages();
|
||||
const auto bookIconUrl = rootLocation + "/catalog/v2/illustration/" + bookId + "/?size=48";
|
||||
const auto tags = bookObj.getTags();
|
||||
std::string faviconAttr = "style=background-image:url(" + bookIconUrl + ")";
|
||||
booksData.push_back(kainjow::mustache::object{
|
||||
{"id", contentId},
|
||||
{"title", bookTitle},
|
||||
{"description", bookDescription},
|
||||
{"langCode", langCode},
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
<div class="book__list">
|
||||
{{#books}}
|
||||
<div class="book__wrapper">
|
||||
<a class="book__link" href="#" title="Preview" aria-label="Preview">
|
||||
<a class="book__link" href="{{root}}/content/{{id}}" title="Preview" aria-label="Preview">
|
||||
<div class="book__link__wrapper">
|
||||
<div class="book__icon" {{faviconAttr}}></div>
|
||||
<div class="book__header">
|
||||
|
|
Loading…
Reference in New Issue