Skip to content

Commit

Permalink
Add specific link for Kiwix RSS Feed
Browse files Browse the repository at this point in the history
Added an image of rss logo on the welcome page which links to the RSS feed with current filters
  • Loading branch information
juuz0 committed Feb 8, 2023
1 parent 4ac2f7b commit 6012dd0
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
1 change: 1 addition & 0 deletions static/resources_list.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
skin/caret.png
skin/bittorrent.png
skin/magnet.png
skin/feed.png
skin/download.png
skin/hash.png
skin/search-icon.svg
Expand Down
Binary file added static/skin/feed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions static/skin/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,13 @@ body {
width: auto;
}

.feedLogo {
margin: 16px 12px 0 0;
height: 30px;
float: right;
border-radius: 5px;
}

@media screen and (max-width: 1100px) {

.kiwixHomeBody {
Expand Down Expand Up @@ -482,4 +489,8 @@ body {
.kiwixNav__filters {
grid-template-columns: 1fr;
}

.feedLogo {
display: none;
}
}
4 changes: 3 additions & 1 deletion static/skin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
filteredParams.append(key, value);
}
}
document.querySelector('#feed_link').href = `${root}/catalog/v2/entries?${filteredParams.toString()}`;
const feedLink = `${root}/catalog/v2/entries?${filteredParams.toString()}`;
document.querySelector('#feed_link').href = feedLink;
document.querySelector('#feedLink').href = feedLink;
}

function queryUrlBuilder() {
Expand Down
3 changes: 3 additions & 0 deletions static/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
<script type="text/javascript" src="{{root}}/skin/index.js?KIWIXCACHEID" defer></script>
</head>
<body>
<a href="{{root}}/catalog/v2/entries" id="feedLink">
<img src="{{root}}/skin/feed.png?KIWIXCACHEID" class="feedLogo" alt="Library OPDS Feed" aria-label="Library OPDS Feed" title="Library OPDS Feed">
</a>
<div class='kiwixNav'>
<div class="kiwixNav__filters">
<div class="kiwixNav__select">
Expand Down
9 changes: 5 additions & 4 deletions test/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ const ResourceCollection resources200Compressible{
{ DYNAMIC_CONTENT, "/ROOT/skin/favicon/favicon.ico" },
{ STATIC_CONTENT, "/ROOT/skin/favicon/favicon.ico?cacheid=fba03a27" },
{ DYNAMIC_CONTENT, "/ROOT/skin/index.css" },
{ STATIC_CONTENT, "/ROOT/skin/index.css?cacheid=0f9ba34e" },
{ STATIC_CONTENT, "/ROOT/skin/index.css?cacheid=316dbc21" },
{ DYNAMIC_CONTENT, "/ROOT/skin/index.js" },
{ STATIC_CONTENT, "/ROOT/skin/index.js?cacheid=3f19d670" },
{ STATIC_CONTENT, "/ROOT/skin/index.js?cacheid=8291a0a6" },
{ DYNAMIC_CONTENT, "/ROOT/skin/iso6391To3.js" },
{ STATIC_CONTENT, "/ROOT/skin/iso6391To3.js?cacheid=ecde2bb3" },
{ DYNAMIC_CONTENT, "/ROOT/skin/isotope.pkgd.min.js" },
Expand Down Expand Up @@ -259,7 +259,7 @@ TEST_F(ServerTest, CacheIdsOfStaticResources)
const std::vector<UrlAndExpectedResult> testData{
{
/* url */ "/ROOT/",
R"EXPECTEDRESULT( href="/ROOT/skin/index.css?cacheid=0f9ba34e"
R"EXPECTEDRESULT( href="/ROOT/skin/index.css?cacheid=316dbc21"
<link rel="apple-touch-icon" sizes="180x180" href="/ROOT/skin/favicon/apple-touch-icon.png?cacheid=f86f8df3">
<link rel="icon" type="image/png" sizes="32x32" href="/ROOT/skin/favicon/favicon-32x32.png?cacheid=79ded625">
<link rel="icon" type="image/png" sizes="16x16" href="/ROOT/skin/favicon/favicon-16x16.png?cacheid=a986fedc">
Expand All @@ -271,7 +271,8 @@ R"EXPECTEDRESULT( href="/ROOT/skin/index.css?cacheid=0f9ba34e"
src: url("/ROOT/skin/fonts/Roboto.ttf?cacheid=84d10248") format("truetype");
<script src="/ROOT/skin/isotope.pkgd.min.js?cacheid=2e48d392" defer></script>
<script src="/ROOT/skin/iso6391To3.js?cacheid=ecde2bb3"></script>
<script type="text/javascript" src="/ROOT/skin/index.js?cacheid=3f19d670" defer></script>
<script type="text/javascript" src="/ROOT/skin/index.js?cacheid=8291a0a6" defer></script>
<img src="/ROOT/skin/feed.png?cacheid=56a672b1" class="feedLogo" alt="Library OPDS Feed" aria-label="Library OPDS Feed" title="Library OPDS Feed">
)EXPECTEDRESULT"
},
{
Expand Down

0 comments on commit 6012dd0

Please sign in to comment.