-
Notifications
You must be signed in to change notification settings - Fork 44
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 titles-only RSS feed #47
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,13 @@ defmodule ElixirStatus.FeedController do | |
|> send_file(200, "priv/static/images/github/#{user_name}.jpg") | ||
end | ||
|
||
def rss(conn, _params) do | ||
def full_feed(conn, _params) do | ||
postings = Posting.published | ||
render(conn, "rss.xml", postings: postings.entries) | ||
render(conn, "full.xml", postings: postings.entries) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please name all templates like their functions. |
||
end | ||
|
||
def titles_feed(conn, _params) do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rename |
||
postings = Posting.published | ||
render(conn, "titles.xml", postings: postings.entries) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rename |
||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,9 @@ defmodule ElixirStatus.Router do | |
get "/", PostingController, :index | ||
get "/u/:user_name", PostingController, :user | ||
|
||
get "/rss", FeedController, :rss | ||
get "/rss", FeedController, :full_feed | ||
get "/rss-titles", FeedController, :titles_feed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please rename |
||
|
||
get "/about", PageController, :about | ||
get "/open_source", PageController, :open_source | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<rss version="2.0"> | ||
<channel> | ||
<title>ElixirStatus</title> | ||
<description><%= ElixirStatus.Meta.rss_title %></description> | ||
<link><%= ElixirStatus.URL.from_path("/") %></link> | ||
<%= for posting <- @postings do %> | ||
<item> | ||
<title><![CDATA[<%= xml_strip_tags posting.title %>]]></title> | ||
<pubDate><%= xml_readable_date posting.published_at %></pubDate> | ||
<link><%= to_permalink(@conn, posting) %></link> | ||
<guid><%= to_permalink(@conn, posting) %></guid> | ||
</item> | ||
<% end %> | ||
</channel> | ||
</rss> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,8 @@ | |
<span class="sidebar-nav-item sidebar-nav-item--text"><%= gettext "You can follow via" %></span> | ||
<a class="sidebar-nav-item no-hover-decoration" href="http://elixirweekly.net/" target="_blank"><span class="badge badge--new">NEW!</span> <span class="hover-decoration">ElixirWeekly</span></a> | ||
<a class="sidebar-nav-item" href="https://twitter.com/elixirstatus" target="_blank">Twitter</a> | ||
<a class="sidebar-nav-item" href="/rss">RSS</a> | ||
<a class="sidebar-nav-item" href="/rss">RSS (full)</a> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please revert all changes to this file. |
||
<a class="sidebar-nav-item" href="/rss-titles">RSS (titles)</a> | ||
|
||
<span class="sidebar-nav-item sidebar-nav-item--text"><%= gettext "Running on Phoenix!" %></span> | ||
<a class="sidebar-nav-item" href="https://github.com/rrrene/elixirstatus-web" target="_blank"><%= gettext "Open Source" %></a> | ||
|
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.
Please revert all changes to this function.