Conversation
4ddae1a to
9acc978
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds logo and icon elements to the OPDS feed to replace the generic RSS logo. The implementation includes adding the Kiwix logo URL to the OPDS template data and updating XML templates to render these elements.
- Adds
<logo>and<icon>elements to OPDS feed XML templates - Updates test expectations across multiple catalog endpoints to include the new logo elements
- Uses the Kiwix logo hosted on Wikimedia Commons
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/opds_dumper.cpp | Adds logo_url field to template data in both OPDS feed generation functions |
| static/templates/catalog_entries.xml | Adds logo and icon XML elements to the catalog template |
| static/templates/catalog_v2_entries.xml | Adds logo and icon XML elements to the v2 catalog template |
| test/library_server.cpp | Updates all test expectations to include the new logo and icon elements in expected XML output |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
kelson42
left a comment
There was a problem hiding this comment.
Thank younfor your PR.
The issue is onky about the feed logo, you should not add default kiwix logog everywhere.
The logo shoukd be embedded in Kiwix code base and we should not rely on an online one (otherwise it won't work offline).
hi! |
veloman-yunkan
left a comment
There was a problem hiding this comment.
I am pretty sure that the final form of this PR has not been tested via kiwix-serve.
src/opds_dumper.cpp
Outdated
|
|
||
| namespace | ||
| { | ||
| const std::string kiwix_logo_url="static/skin/kiwix_logo.png"; |
There was a problem hiding this comment.
This is a relative URL. I doubt that it will work in all (even the most typical) cases.
static/skin/kiwix_logo.png
Outdated
There was a problem hiding this comment.
- Does this logo indeed have to be this big? Can't we reuse
static/skin/favicon/favicon-32x32.png? - Just adding this file under
static/skindoesn't automatically make it an embedded resource oflibkiwix. It also has to be registered instatic/resources_list.txt, and tested intest/server.cpp(similar to how it is done forfavicon-32x32.png).
There was a problem hiding this comment.
Does this logo indeed have to be this big? Can't we reuse
static/skin/favicon/favicon-32x32.png?
- Just adding this file under
static/skindoesn't automatically make it an embedded resource oflibkiwix. It also has to be registered instatic/resources_list.txt, and tested intest/server.cpp(similar to how it is done forfavicon-32x32.png).
yes i guess we should use faivon-32X32 png, it is small and squared. I'll do the required changes.
|
@rajvi0106 What is the status here? I see comment from @veloman-yunkan which are not been clearly answered and it is not clear either if this has been fixed. Please answer each of them pointing to the solution and let us now with a general comment if you are ready for a new review. |
sorry for the delay, you are correct even now when i changed the logo and used favicon logo when running the kiwix serve /catalog/v2/entries it is showing the url i used in first commit. |
|
@kelson42 @veloman-yunkan sorry for the delay! I have made the changes. Please review and let me know what you think and if any further adjustments are needed. |
veloman-yunkan
left a comment
There was a problem hiding this comment.
I reiterate my previous assessment that this PR has not been tested via kiwix-serve. Please make sure that your changes achieve the desired effect in the tools where they can have a user-visible effect.
|
Hii! @veloman-yunkan |
veloman-yunkan
left a comment
There was a problem hiding this comment.
Good! Now this looks like it can work, though I have yet to test it. But I will do so after my comments are addressed.
src/opds_dumper.cpp
Outdated
| {"books", booksData } | ||
| {"books", booksData }, | ||
| {"logo_url", baseUrl+kiwix_logo_url} |
There was a problem hiding this comment.
- Does the logo/icon URL have to be a full URL (i.e. including the scheme and host components)? Can't it be just an absolute URL (referring to the same host)?
- Please take into account the
-r/--urlRootLocationoption ofkiwix-serve
There was a problem hiding this comment.
using a full url was the first approach which came to my mind (to make sure that the image opens up in browser or RSS feed reader) but sure i will use the absolute url referring to the same host.
src/opds_dumper.cpp
Outdated
| {"books", booksData } | ||
| {"books", booksData }, | ||
| {"logo_url", baseUrl + kiwix_logo_url} |
test/library_server.cpp
Outdated
| try { | ||
| s = std::regex_replace(s, std::regex("https?://(?:localhost|127\\.0\\.0\\.1)(?::[0-9]+)?"), ""); | ||
| s = std::regex_replace(s, std::regex("https?://\\[::1\\](?::[0-9]+)?"), ""); | ||
| } catch (...) {} | ||
|
|
There was a problem hiding this comment.
I don't like this, but it may be automatically solved if an absolute URL instead of a full URL can be used for the logo/icon URL.
|
@veloman-yunkan sorry for the delay! please review it |
veloman-yunkan
left a comment
There was a problem hiding this comment.
Please squash all your commits into one
... and rebase your branch on recent |
fc68a76 to
0e2e3f5
Compare
avoid hard coded url and added feed logo file favicon logo used removed a test line Use contentServerURL to build absolute OPDS logo/icon links fix logo url so it renders in browser and readers use of absolute url
0e2e3f5 to
92ba25a
Compare
veloman-yunkan
left a comment
There was a problem hiding this comment.
This PR now looks almost ready to be merged so I decided to test it, but no icon/logo was displayed in the Feedbro feed reader extension for Firefox which I installed just for testing this PR (I didn't use a feed reader for many years). How did you test it?
Regarding the commit message - it bears all the history of how this change came to be. We don't need it. Please clean up the commit message. Also please eliminate the accidental or left-over changes unrelated to the functionality being implemented.
| #include "library.h" | ||
| #include "name_mapper.h" | ||
| #include "library_dumper.h" | ||
| #include "server/request_context.h" |
| { | ||
| const auto endpointRoot = rootLocation + "/catalog/v2"; | ||
| const auto booksData = getBooksData(library, nameMapper, bookIds, rootLocation, contentAccessUrl, partial); | ||
|
|
|
|
||
| TEST_F(LibraryServerTest, catalog_root_xml) | ||
| { | ||
| { |
the logo is being served correctly in browser but in feedbro and and thorium reader no logo is there |
What do you mean by that? Accessing http://localhost:PORT/skin/favicon/favicon-32x32.png directly? |
yes yes when i am running it directly is showing the picture used |
|
Then the next question is what made you think that the logo URL in OPDS xml should be exposed via the |
|
https://validator.w3.org/feed/docs/atom.html |
|
I checked that it works in thunderbird. But now that you pointed to the spec, I see that the 32x32 image doesn't comply with what is expected from a |
|
yes that is why i used both logo and icon tags because i was using a different image earlier. So should i go forward with adding link tag or remove the logo tag? |


Fixes #976
Problem
The OPDS feed lacks support of element and instead falls back to the generic non descriptive RSS logo.
Solution
To address this issue first extended the render template by adding logo_url, then to actually render this value OPDS XML file is extended with and element (both to ensure it is sized well for different screen sizes), and then updates the expected output in library_server to match the generated xml.
Changes Implemented