feat(talk): add support for event address

Forms part of the transition from Microdata to JSON-LD.

See #413
This commit is contained in:
George Cushen committed 2019-09-09 17:33:08 +01:00
1 parent d8fa0b9523
commit ec4f5a11bf
4 files changed
+38 -4

No files matched your search

+6
View File
@@ -5,6 +5,12 @@ title: "{{ replace .Name "-" " " | title }}"
event:
event_url:
location:
address:
street:
city:
region:
postcode:
country:
summary:
abstract:
+9 -1
View File
@@ -2,7 +2,15 @@
title: Example Talk
event: Academic Theme Conference
event_url: https://example.org
location: London, United Kingdom
location: Source Themes HQ
address:
street: 450 Serra Mall
city: Stanford
region: CA
postcode: '94305'
country: United States
summary: An example talk using Academic's Markdown slides feature.
abstract: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis posuere tellusac convallis placerat. Proin tincidunt magna sed ex sollicitudin condimentum. Sed ac faucibus dolor, scelerisque sollicitudin nisi. Cras purus urna, suscipit quis sapien eu, pulvinar tempor diam."
+10 -1
View File
@@ -28,7 +28,16 @@
{{ with $page.Params.location }}
"location": {
"@type": "Place",
"name": {{. | plainify}}
"name": {{. | plainify}}{{if $page.Params.address}},
"address": {
"@type": "PostalAddress",
"streetAddress": {{$page.Params.address.street | default ""}},
"addressLocality": {{$page.Params.address.city | default ""}},
"postalCode": {{$page.Params.address.postcode | default ""}},
"addressRegion": {{$page.Params.address.region | default ""}},
"addressCountry": {{$page.Params.address.country | default ""}}
}
{{end}}
},
{{end}}
{{ if $featured_image }}
+13 -2
View File
@@ -43,13 +43,24 @@
</div>
<div class="d-md-none space-below"></div>
{{ with .Params.location }}
{{ if .Params.location }}
<div class="row">
<div class="col-md-1"></div>
<div class="col-md-10">
<div class="row">
<div class="col-12 col-md-3 pub-row-heading">{{ i18n "location" }}</div>
<div class="col-12 col-md-9">{{ . | markdownify }}</div>
<div class="col-12 col-md-9">{{ .Params.location | markdownify }}</div>
{{ if .Params.address }}
{{ $addr := slice }}
{{with .Params.address.street}}{{$addr = $addr | append .}}{{end}}
{{with .Params.address.city}}{{$addr = $addr | append .}}{{end}}
{{with .Params.address.region}}{{$addr = $addr | append .}}{{end}}
{{with .Params.address.postcode}}{{$addr = $addr | append .}}{{end}}
{{with .Params.address.country}}{{$addr = $addr | append .}}{{end}}
{{ $addr_formatted := delimit $addr (site.Params.address_delimiter | default ", ") }}
<div class="col-md-3"></div>
<div class="col-12 col-md-9">{{$addr_formatted}}</div>
{{end}}
</div>
</div>
<div class="col-md-1"></div>