From c55897d361a4e2cf9f5a63e2fcde14d4490210ab Mon Sep 17 00:00:00 2001 From: Ivan Date: Mon, 2 Oct 2017 19:51:17 +0200 Subject: [PATCH] Improve rss feed (#44) * Improve rss feed * Fixes after code review --- README.md | 1 + src/controllers/rss_controller.cr | 2 ++ src/views/rss/show.slang | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 771f1ac..4ff91e3 100644 --- a/README.md +++ b/README.md @@ -77,4 +77,5 @@ TWITTER_ACCESS_TOKEN_SECRET * [veelenga](https://github.com/veelenga) V. Elenhaupt - creator, maintainer * [hugoabonizio](https://github.com/hugoabonizio) Hugo Abonizio - contributor, maintainer +* [janczer](https://github.com/janczer) Janczer - contributor * [lex111](https://github.com/lex111) Alexey Pyltsyn - contributor \ No newline at end of file diff --git a/src/controllers/rss_controller.cr b/src/controllers/rss_controller.cr index e71dd7e..8448a86 100644 --- a/src/controllers/rss_controller.cr +++ b/src/controllers/rss_controller.cr @@ -1,4 +1,6 @@ class RSSController < Amber::Controller::Base + include Helpers::TimeAgoHelper + def show announcements = Announcement.newest diff --git a/src/views/rss/show.slang b/src/views/rss/show.slang index 6cd2872..312842d 100644 --- a/src/views/rss/show.slang +++ b/src/views/rss/show.slang @@ -8,6 +8,10 @@ rss version=2.0 item title = announcement.title description = announcement.content + | #{announcement.typename}. + | Announced #{time_ago_in_words(announcement.created_at.not_nil!)} by + - if user = announcement.user + | #{user.login} pubDate = announcement.created_at.try &.to_s "%d %b %Y %T %z" #{SITE.url}/announcements/#{announcement.id} guid #{SITE.url}/announcements/#{announcement.id}