Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OPDS/Atom Feed link in HTML head #882

Merged
merged 2 commits into from
Feb 9, 2023
Merged

Add OPDS/Atom Feed link in HTML head #882

merged 2 commits into from
Feb 9, 2023

Conversation

juuz0
Copy link
Collaborator

@juuz0 juuz0 commented Feb 5, 2023

Fixes #832

@juuz0 juuz0 requested a review from kelson42 February 5, 2023 12:03
@codecov
Copy link

codecov bot commented Feb 5, 2023

Codecov Report

Base: 71.95% // Head: 71.95% // No change to project coverage 👍

Coverage data is based on head (6b8f9aa) compared to base (fa80be8).
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #882   +/-   ##
=======================================
  Coverage   71.95%   71.95%           
=======================================
  Files          54       54           
  Lines        3748     3748           
  Branches     2100     2100           
=======================================
  Hits         2697     2697           
  Misses       1049     1049           
  Partials        2        2           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@juuz0
Copy link
Collaborator Author

juuz0 commented Feb 5, 2023

I think this is what was needed here (using Want My RSS extension on firefox - there was no inbuilt way to check which i know of). It links to the atom feed with correct filters. Working!

image

@kelson42
Copy link
Collaborator

kelson42 commented Feb 5, 2023

@juuz0 Thank you, I will give a try

@kelson42
Copy link
Collaborator

kelson42 commented Feb 5, 2023

@juuz0 What you have done looks good to me from a user perspective. That is what I was expecting.

@juuz0
Copy link
Collaborator Author

juuz0 commented Feb 5, 2023

@kelson42 Awesome! I don't why the CI is failing though, is it a common problem to current-libkiwix or just this PR?

(As a sidenote, how did you check the RSS feed? Is there an inbuilt feature in firefox/other browser?)

@kelson42
Copy link
Collaborator

kelson42 commented Feb 5, 2023

@kelson42 Awesome! I don't why the CI is failing though, is it a common problem to current-libkiwix or just this PR?

Yes, a problem with the package building. Nothing related to your PR.

(As a sidenote, how did you check the RSS feed? Is there an inbuilt feature in firefox/other browser?)

I checked the HTML and know how this feature should work. I have also a proper browser which displays an icon in the searchbar.

@juuz0
Copy link
Collaborator Author

juuz0 commented Feb 6, 2023

Added image @kelson42
It's hidden in mobile version because I don't know the correct design to put it (might need discussion here if it's desirable)

I also did a rebase so please remember that while pulling :>
image

static/templates/index.html Outdated Show resolved Hide resolved
static/skin/index.js Outdated Show resolved Hide resolved
static/templates/index.html Outdated Show resolved Hide resolved
Copy link
Member

@mgautierfr mgautierfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code seems good to me.
(Edit: But I have missed the wrong usage of the api, I agree with @veloman-yunkan here, better using /catalog/v2/entries)

However, I think the icon is a bit to lower, I would have put it at the top-right of the top bar.
But I will not block for that if there is a consensus against me.

@kelson42
Copy link
Collaborator

kelson42 commented Feb 6, 2023

However, I think the icon is a bit to lower, I would have put it at the top-right of the top bar.

Yes, top-right corner would be better IMO too.

@juuz0
Copy link
Collaborator Author

juuz0 commented Feb 6, 2023

However, I think the icon is a bit to lower, I would have put it at the top-right of the top bar.

Done.

Unrelated to this issue but https://github.com/kiwix/libkiwix/blob/main/static/skin/index.js#L22 is also using the old API, should that be changed too?

@kelson42
Copy link
Collaborator

kelson42 commented Feb 7, 2023

Unrelated to this issue but https://github.com/kiwix/libkiwix/blob/main/static/skin/index.js#L22 is also using the old API, should that be changed too?

yes please

static/templates/index.html Outdated Show resolved Hide resolved
static/templates/index.html Outdated Show resolved Hide resolved
Copy link
Collaborator

@kelson42 kelson42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works fine but few changes necessary to be polished

static/resources_list.txt Outdated Show resolved Hide resolved
static/skin/index.css Outdated Show resolved Hide resolved
static/skin/index.js Outdated Show resolved Hide resolved
static/templates/index.html Show resolved Hide resolved
static/templates/index.html Outdated Show resolved Hide resolved
@juuz0
Copy link
Collaborator Author

juuz0 commented Feb 8, 2023

Rebased on main

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;
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see in the current naming of the OPDS feed link ids a risk that any future links will be named feedlink, FeedLink, etc :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was worried about it too :P but kelson's recommendation so I let it pass.
What do you think is a better name?
@kelson42 @veloman-yunkan

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep only version of feedLink or feed_link to have the naming consistant.
But we should have a id for the link in the head as head_feed_link (or headFeedLink) and feed_link (or FeedLink).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

headFeedLink then :)

@kelson42 kelson42 changed the title Add RSS Feed extension in head Add OPDS/Atom Feed extension in HTML head Feb 8, 2023
@kelson42 kelson42 changed the title Add OPDS/Atom Feed extension in HTML head Add OPDS/Atom Feed link in HTML head Feb 8, 2023
Copy link
Member

@mgautierfr mgautierfr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are good on my side.

You could have set the head id to headFeedLink in the first commit to avoid the change in the second commit. But I will not block for that.

@mgautierfr
Copy link
Member

@juuz0 Please rebase on master so we can merge.

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.
Added an image of rss logo on the welcome page which links to the RSS feed with current filters
@juuz0
Copy link
Collaborator Author

juuz0 commented Feb 9, 2023

@mgautierfr Done.

@mgautierfr
Copy link
Member

@juuz0 Thanks.

Comment from @kelson42 has been addressed. So I think we are free to merge without its review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a feed link to kiwix-serve welcome page
4 participants