commit: 54e3431ef9467bdfd501c3878291905c055385b9
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Sat Apr 25 11:19:17 2015 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Sat Apr 25 11:22:51 2015 +0000
URL: https://gitweb.gentoo.org/sites/www.git/commit/?id=54e3431e
Skip news items in the planet box
_plugins/planet.rb | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/_plugins/planet.rb b/_plugins/planet.rb
index 4c9df0d..265e703 100644
--- a/_plugins/planet.rb
+++ b/_plugins/planet.rb
@@ -11,6 +11,7 @@ module Gentoo
planetinfo.xpath('/rss/channel/item').each do |item|
item_data = {}
+ ignore = false
item.children.each do |tag|
case tag.name
@@ -22,11 +23,14 @@ module Gentoo
if tag.text =~ /^(.*) \(([^)]+)\)$/
item_data['author'] = $1
item_data['nick'] = $2
+ else
+ # It's a news item; skip
+ ignore = true
end
end
end
- site.data['planet']['posts'] << item_data
+ site.data['planet']['posts'] << item_data unless ignore
end
end