Skip to content

Commit

Permalink
Releasing theme version 1.5.1 (devopsdays#2167)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattstratton authored Mar 29, 2017
1 parent 872afd3 commit 12b80ef
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 17 deletions.
9 changes: 8 additions & 1 deletion themes/devopsdays-theme/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log

## [1.5.0](https://github.com/devopsdays/devopsdays-theme/tree/1.5.0) (2017-03-27)
## [1.5.1](https://github.com/devopsdays/devopsdays-theme/tree/1.5.1) (2017-03-29)
[Full Changelog](https://github.com/devopsdays/devopsdays-theme/compare/1.5.0...1.5.1)

**Fixed bugs:**

- schema.org for events should only display if location\_address is set [\#445](https://github.com/devopsdays/devopsdays-theme/issues/445)

## [1.5.0](https://github.com/devopsdays/devopsdays-theme/tree/1.5.0) (2017-03-28)
[Full Changelog](https://github.com/devopsdays/devopsdays-theme/compare/1.4.1...1.5.0)

**Implemented enhancements:**
Expand Down
38 changes: 23 additions & 15 deletions themes/devopsdays-theme/layouts/partials/events/event_metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,32 @@
{{ $e := (index $.Site.Data.events $event_slug) }}
{{/* end site data query */}}

{{ $.Scratch.Add "url" $.Site.Params.weburl }}
{{ $.Scratch.Set "url" $.Site.Params.weburl }}
{{ $.Scratch.Add "url" "/events/"}}
{{ $.Scratch.Add "url" $event_slug }}
{{ $.Scratch.Set "contentdir" (printf "static/events/%s/" $event_slug) }}

{{ $url := $.Scratch.Get "url" }}
{{ $.Scratch.Set "image_url" ($.Scratch.Get "url") }}

{{ if (where (readDir "static/events") "Name" $event_slug)}}

{{- if $e.startdate -}}

{{ if (where (readDir ($.Scratch.Get "contentdir")) "Name" "logo.jpg") }}
{{ $.Scratch.Add "image_url" "/logo.jpg" }}
{{ else }}
{{ $.Scratch.Add "image_url" "/logo.png" }}
{{ end }}

{{ else }}
{{$.Scratch.Set "image_url" $.Site.Params.weburl }}
{{$.Scratch.Add "image_url" "/img/event-logo-square.jpg"}}
{{ end}}



{{- if and $e.startdate $e.location_address -}}

{{ $url := $.Scratch.Get "url" }}
{{ $.Scratch.Add "image_url" $url }}
{{ $.Scratch.Add "image_url" "/logo.png" }}
{{ $image_url := $.Scratch.Get "image_url" }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
Expand All @@ -28,22 +41,17 @@
"name": "devopsdays {{ $e.city }} {{ $e.year }}",
"startDate": "{{ $e.startdate }}",
"endDate": "{{ $e.enddate }}",
"url": "{{ $url }}",
"image": "{{ $image_url }}",
"url": "{{ $.Scratch.Get "url" }}",
"image": "{{ $.Scratch.Get "image_url" }}",
"location": {
"@type": "Place",
{{ if eq $e.city $e.location }}
"name": "{{ $e.city }}",
{{ else }}
"name": "{{ $e.location }}, {{ $e.city }}",
{{ end }}
{{ if $e.location_address }}
{{ if ne $e.location_address "" }}
"address": "{{ $e.location_address }}"
{{ else }}
"address": "{{ $e.coordinates }}"
{{ end }}
{{ end }}
"address": "{{ $e.location_address }}"

}
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion themes/devopsdays-theme/theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage = "https://github.com/devopsdays/devopsdays-theme/"
tags = ["", ""]
features = ["", ""]
min_version = 0.18
theme_version = 1.5.0
theme_version = 1.5.1

[author]
name = "Matt Stratton"
Expand Down

0 comments on commit 12b80ef

Please sign in to comment.