houdini/app/views/campaigns/_schema.html.erb
2020-06-15 10:26:57 -05:00

28 lines
776 B
Text

<%- # License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE -%>
<% schema = {
"@context": "http://schema.org",
"@type": "Event",
"name": @campaign.name ,
"description": @campaign.summary.present? ? @campaign.summary : @campaign.name ,
"url": url ,
"location": {
"@type": "Place",
"name": @campaign.name ,
"address": {
"@type": "PostalAddress",
"addressLocality": @nonprofit.city,
"addressRegion": @nonprofit.state_code,
"postalCode": @nonprofit.zip_code ,
"streetAddress": @nonprofit.address
}
},
"startDate": @campaign.created_at
}
%>
<script type="application/ld+json">
<%= raw(JSON::generate(schema)) %>
</script>