Calendar: Relative links on website, absolute in ical
This commit is contained in:
parent
981a7644df
commit
99a506481c
5 changed files with 82 additions and 78 deletions
|
|
@ -25,7 +25,11 @@ cal = RiCal.Calendar do |cal|
|
|||
end
|
||||
event.uid = Digest::SHA1.hexdigest("#{e[:startdate]}#{e[:title]}")
|
||||
if e[:url]
|
||||
event.url = e[:url]
|
||||
if e[:url].start_with?('/')
|
||||
event.url = "#{@config[:base_url]}#{e[:url]}"
|
||||
else
|
||||
event.url = e[:url]
|
||||
end
|
||||
elsif e.identifier.start_with?('/events') or e.identifier.start_with?('/activities')
|
||||
event.url = "#{@config[:base_url]}#{e.path}"
|
||||
event.uid = Digest::SHA1.hexdigest("#{@config[:base_url]}#{e.path}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue