gancio-upstream/views/feed/rss.pug

30 lines
1.6 KiB
Text

doctype xml
rss(version='2.0' xmlns:atom="http://www.w3.org/2005/Atom")
channel
atom:link(href=`${link}` rel="self" type="application/rss+xml")
title #{title}
link #{settings.baseurl}
description #{settings.description}
each event in events
item
if (event.media && event.media.length)
<enclosure url="#{settings.baseurl}/media/#{event.media[0].url}" type='image/jpeg' length="#{event.media[0].size||1}"></enclosure>
title [#{unixFormat(event.start_datetime,"yyyy-MM-dd")}] #{event.title} @ #{event.place.name}
link #{settings.baseurl}/event/#{event.slug || event.id}
each tag in event.tags
category #{tag.tag || tag}
description
| <![CDATA[
| <h3>#{event.title}</h3>
if (event.place.name === 'online')
| <strong>online - <a href="#{event.online_locations[0]}">#{event.online_locations[0]}</a></strong>
else
| <strong>#{event.place.name} - #{event.place.address}</strong>
| <br/><small>(#{unixFormat(event.start_datetime,"EEEE, d MMMM HH:mm")})</small><br/>
if (event.media && event.media.length)
| <img alt="#{event.media[0].name || ''}" src="#{settings.baseurl}/media/#{event.media[0].url}"/>
| !{event.description}
| ]]>
pubDate= new Date(event.updatedAt).toUTCString()
guid #{settings.baseurl}/event/#{event.slug || event.id}