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

RSS feed fixes #28

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

RSS feed fixes #28

wants to merge 6 commits into from

Conversation

msurdi
Copy link
Contributor

@msurdi msurdi commented Nov 1, 2024

πŸ”— Linked issue

#19 (comment)

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

As described in #19 (comment), after we've implemented the RSS feed for the blog entries, we found a few validation issues and some warnings.

This PR solves the main feed validation problems and addresses most of the warnings.

The only remaining warning is about having relative URLs within the posts contents. I don't think there's much we can do without hacky string manipulations to resolve this from the feed point of view.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@@ -16,11 +16,11 @@
@each(post in blogPosts)
<item>
<title><![CDATA[{{ post.title }}]]></title>
<link>{{ route('blog.show', [post.slug]) }}</link>
<guid>{{ post.slug }}</guid>
<link>https://adonisjs.com{{ route('blog.show', [post.slug]) }}</link>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this the best way to get an absolute URL containing the right domain?

<pubDate>{{ post.publishedAt }}</pubDate>
<description><![CDATA[ {{{ post.contentHtml.summary }}} ]]></description>
<content:encoded><![CDATA[ {{{ post.contentHtml.contents }}} ]]></content:encoded>
<description><![CDATA[ {{{ sanitize(post.contentHtml.summary) }}} ]]></description>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sanitization is necessary so that we don't include dangerous elements in the output, such as script tags, etc. This solves almost all of the content related warnings in the validation tool.

@msurdi msurdi marked this pull request as ready for review November 1, 2024 07:25
@msurdi msurdi changed the title Rss fixes RSS feed fixes Nov 1, 2024
@msurdi msurdi mentioned this pull request Nov 1, 2024
6 tasks
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.

1 participant