mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Add RSS Feed extension in head
This change adds a <link> element in the head node of welcome page. Browsers with extensions for RSS will show a sign to navigate to the feed. The link changes based on current set filters.
This commit is contained in:
@ -18,6 +18,17 @@
|
||||
let timer;
|
||||
let languages = {};
|
||||
|
||||
function updateFeedLink() {
|
||||
const inputParams = new URLSearchParams(window.location.search);
|
||||
const filteredParams = new URLSearchParams();
|
||||
for (const [key, value] of inputParams) {
|
||||
if ( value != '' ) {
|
||||
filteredParams.append(key, value);
|
||||
}
|
||||
}
|
||||
document.querySelector('#feed_link').href = `${root}/catalog/v2/entries?${filteredParams.toString()}`;
|
||||
}
|
||||
|
||||
function queryUrlBuilder() {
|
||||
let url = `${root}/catalog/search?`;
|
||||
url += Object.keys(incrementalLoadingParams).map(key => `${key}=${incrementalLoadingParams[key]}`).join("&");
|
||||
@ -363,6 +374,7 @@
|
||||
setCookie(filterCookieName, params.toString());
|
||||
}
|
||||
updateFilterColors();
|
||||
updateFeedLink();
|
||||
await loadAndDisplayBooks(true);
|
||||
}
|
||||
|
||||
@ -492,6 +504,7 @@
|
||||
langFilter.dispatchEvent(new Event('change'));
|
||||
}
|
||||
}
|
||||
updateFeedLink();
|
||||
setCookie(filterCookieName, params.toString());
|
||||
}
|
||||
})();
|
||||
|
@ -10,6 +10,13 @@
|
||||
href="{{root}}/skin/index.css?KIWIXCACHEID"
|
||||
rel="Stylesheet"
|
||||
/>
|
||||
<link
|
||||
rel="alternate"
|
||||
type="application/atom+xml"
|
||||
title="Library OPDS Feed"
|
||||
id="feed_link"
|
||||
href="{{root}}/catalog/v2/entries"
|
||||
/>
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="{{root}}/skin/favicon/apple-touch-icon.png?KIWIXCACHEID">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="{{root}}/skin/favicon/favicon-32x32.png?KIWIXCACHEID">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{root}}/skin/favicon/favicon-16x16.png?KIWIXCACHEID">
|
||||
|
Reference in New Issue
Block a user