-
Notifications
You must be signed in to change notification settings - Fork 27
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 2.0 + atom support #174
base: v1/master
Are you sure you want to change the base?
Conversation
lib/serum/plugins/rss_generator.ex
Outdated
defp create_file(dest, pages, posts) do | ||
%Serum.File{ | ||
dest: Path.join(dest, "rss.xml"), | ||
out_data: rss_xml(pages, posts, &to_rfc822_format/1, bindings()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don''t understand exactly what these 3 & 4th parameter are supposed to do
- what input & return typespec this 3rd function is supposed to have
- how to ensure variables are available in template
<atom:link href="<%= Path.join(Map.fetch!(bindings, :server_root), "/~dch/rss.xml") %>" rel="self" type="application/rss+xml" /> | ||
<%= for post <- posts do %><item> | ||
<link><%= Path.join(Map.fetch!(bindings, :server_root), post.url) %></link> | ||
<guid><%= Path.join(Map.fetch!(bindings, :server_root), post.url) %></guid> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OMG the bindings this is clearly wrong!
@Dalgona any chance this could make it into v1? |
63c52f3
to
637cb89
Compare
on many systems, gen_tcp will not open if port is already in use. Ignore the error, and rely on the subsequent clause to validate the test failure.
@Dalgona this PR brings rss + elixir 1.16/otp26 compatibility. Would be nice to have it reviewed and merged, and published to hex when you have time. |
Passes common validators like: - https://www.rssboard.org/rss-validator/ - https://validator.w3.org/feed/
I added this quickly but it does pass W3C RSS feed validation.
some things I need advice on:
serum.exs
?