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

Item URL should point to post URL #3345

Merged
merged 1 commit into from Jun 26, 2023
Merged

Conversation

simmel
Copy link
Contributor

@simmel simmel commented Jun 25, 2023

If the post is an URL post the item link should point to the URL of the link that is being posted.

See https://www.rssboard.org/rss-specification#hrelementsOfLtitemgt

@simmel
Copy link
Contributor Author

simmel commented Jun 25, 2023

I found #1378 after I submitted this PR but I agree with @Nirose that we should follow the RSS standard:

  • comments is the URL for the lemmy post
  • link is for the URL towards the posted URL. If there is no URL it should be the lemmy post.

See also https://www.rssboard.org/rss-weblog-comments-use-case and https://validator.w3.org/feed/docs/rss2.html#hrelementsOfLtitemgt

@simmel
Copy link
Contributor Author

simmel commented Jun 26, 2023

The build seems to have been stopped due to a timeout https://woodpecker.join-lemmy.org/repos/129/pipeline/372/13

@@ -499,6 +499,7 @@ fn create_post_items(
if let Some(url) = p.post.url {
let link_html = format!("<br><a href=\"{url}\">{url}</a>");
description.push_str(&link_html);
i.link(url.to_string());
Copy link
Member

Choose a reason for hiding this comment

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

This field is already being set above in line 478. So you would have to remove that (which would be a breaking change).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what you mean. I was under the impression that the link attribute in the item was overwritten? Is this not the case?

I'm sorry for not knowing the proper nomenclature but if the lemmy post is a "self post" like https://lemmy.world/post/579472 the item link should go to the same URL as the item comments attribute.
If the lemmy post links to an URL like https://lemmy.world/post/610949 the item link should go to the URL linked in the lemmy post.

Copy link
Member

Choose a reason for hiding this comment

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

Ah that makes sense. Then I would move the i.link(post_url.clone()); into an else branch to make this explicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like that?

If the post is an URL post the item link should point to the URL of the
link that is being posted.
@Nutomic Nutomic merged commit c9e9ff4 into LemmyNet:main Jun 26, 2023
1 check passed
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.

None yet

2 participants