ical export

This commit is contained in:
Stefan Schlott 2013-08-27 20:28:20 +02:00
parent cb3ffbd96e
commit 3db77d4afa
5 changed files with 40 additions and 1 deletions

View file

@ -11,4 +11,5 @@ gem 'rdiscount'
gem 't' gem 't'
gem 'nokogiri' gem 'nokogiri'
gem 'feedzirra' gem 'feedzirra'
gem 'ri_cal'

View file

@ -94,6 +94,7 @@ GEM
rdoc (3.12.2) rdoc (3.12.2)
json (~> 1.4) json (~> 1.4)
retryable (1.3.2) retryable (1.3.2)
ri_cal (0.8.8)
sass (3.2.10) sass (3.2.10)
sax-machine (0.1.0) sax-machine (0.1.0)
nokogiri (> 0.0.0) nokogiri (> 0.0.0)
@ -135,6 +136,7 @@ DEPENDENCIES
nanoc3 nanoc3
nokogiri nokogiri
rdiscount rdiscount
ri_cal
sass sass
systemu systemu
t t

8
Rules
View file

@ -28,6 +28,10 @@ compile '/styles/*' do
end end
end end
compile "/ical" do
filter :erb
end
compile "/htaccess" do compile "/htaccess" do
filter :erb filter :erb
end end
@ -73,6 +77,10 @@ route '/styles/*' do
item.identifier.chop + '.css' item.identifier.chop + '.css'
end end
route "/ical" do
"/cccs.ical"
end
route "/htaccess" do route "/htaccess" do
"/.htaccess" "/.htaccess"
end end

28
content/ical.txt Normal file
View file

@ -0,0 +1,28 @@
<% require 'ri_cal'
upcomingEvents = get_public_events().select { |e| e[:startdate].to_datetime > DateTime.now }
upcomingEvents.sort! { |a,b| a[:startdate].to_datetime <=> b[:startdate].to_datetime }
cal = RiCal.Calendar do |cal|
upcomingEvents.each do |e|
cal.event do |event|
event.summary = e[:title]
event.description = ""
event.dtstart = e[:startdate]
event.dtend = e[:enddate]
if e[:location]
if e[:location][:details]
event.location = "#{e[:location][:name]}, #{e[:location][:details]}"
else
event.location = e[:location][:name]
end
end
if e[:url]
event.url = e[:url]
elsif e.identifier.start_with?('/events')
event.url = e.path
end
end
end
end
%><%= cal.to_s %>

View file

@ -21,7 +21,7 @@ feed:
stehen die Termine von uns veranstalteter Aktionen. Zusätzlich sind wir stehen die Termine von uns veranstalteter Aktionen. Zusätzlich sind wir
mitunter bei fremden Veranstaltungen eingeladen, die findest Du unter mitunter bei fremden Veranstaltungen eingeladen, die findest Du unter
<a href="/activities/">Aktivitäten</a> (möglicherweise sind nicht alle öffentlich). <a href="/activities/">Aktivitäten</a> (möglicherweise sind nicht alle öffentlich).
Du kannst all diese Termine auch <a href="#">per ical abonnieren</a>. Du kannst all diese Termine auch <a href="/cccs.ical">per ical abonnieren</a>.
<p> <p>
<strong>Aktuelle Informationen?</strong> Unten auf der Seite stehen blog-artig <strong>Aktuelle Informationen?</strong> Unten auf der Seite stehen blog-artig
Artikel und Notizen. Wenn Du diese automatisch beziehen möchtest, kannst Artikel und Notizen. Wenn Du diese automatisch beziehen möchtest, kannst