Skip to content

Commit

Permalink
Merge pull request #78 from devopsdays/mattstratton/refactor-event-slug
Browse files Browse the repository at this point in the history
Refactor for event path
  • Loading branch information
mattstratton committed Mar 7, 2016
2 parents c01db30 + b5527a5 commit b66c204
Show file tree
Hide file tree
Showing 40 changed files with 132 additions and 29 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
+++
City = "WashingtonDC"
City = "Washington D.C."
Year ="2016"
date = "2016-03-06T21:15:25-06:00"
title = "welcome"
type = "event"
aliases = ["/events/2016-detroit"]
aliases = ["/events/2016-washington-dc"]


+++
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions data/events/2016-chicago.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: 2016chicago
year: "2016"
city: "Chicago"
friendly: "2016-chicago"
status: "current"
startdate: 2016-08-30
enddate: 2016-08-31
cfp_date_start: 2016-04-01
cfp_date_end: 2016-06-01
cfp_date_announce: 2016-07-01
coordinates: "41.882219, -87.640530"
location: "Summit West"
navigationelements: ["welcome", "contact", "location", "program", "propose", "proposals", "conduct", "sponsor"]
team: ["Jerry Cattell", "Brian Devlin", "Michael Lanyon", "Aaron Lindstrom", "Chris Read", "Kevin Reedy", "Sasha Rosenbaum", "Matt Stratton"]
organizer_email: "[email protected]"
proposal_email: "[email protected]"
ga_tracking_id: "UA-74738648-1"

sponsors:
- id: chef
level: gold
- id: arresteddevops
level: community
- id: softwaredefinedtalk
level: community

sponsor_levels:
- id: gold
label: Gold
- id: silver
label: Silver
- id: bronze
label: Bronze
- id: community
label: Community
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions data/events/2016-kiel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 2016kiel
year: "2016"
city: "Kiel"
friendly: "2016-kiel"
status: "current"
startdate: 2016-05-12
enddate: 2016-05-13
coordinates: "54.3233, 10.1228"
navigationelements: ["welcome", "contact", "location", "program", "propose", "proposals", "registration", "conduct", "sponsor"]
team: ["Jerry Cattell", "Brian Devlin", "Michael Lanyon", "Aaron Lindstrom", "Chris Read", "Kevin Reedy", "Sasha Rosenbaum", "Matt Stratton"]
organizer_email: "[email protected]"
proposal_email: "[email protected]"
sponsors:
- id: kiwi
level: host
- id: wobe
level: special
override:
url: www.microsoft.co.il
- id: puppet
level: special

sponsor_levels:
- id: gold
label: Gold
- id: host
label: Host
- id: special
label: Special
- id: silver
label: Silver
- id: media
label: Media
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 2016washingtondc # The name of the event. Four digit year with the city name in lower-case, with no spaces.
year: "2016" # The year of the event. Make sure it is in quotes.
city: "Washington, D.C. " # The city name of the event. Capitalize it.
friendly: "2016-washingtondc" # Four digit year and the city name in lower-case. Don't forget the dash!
friendly: "2016-washington-dc" # Four digit year and the city name in lower-case. Don't forget the dash!
status: "current" # Options are "past" or "current".
startdate: 2016-06-08 # The start date of your event, in YYYY-MM-DD format. Leave blank if you don't have a date yet.
enddate: 2016-06-09 # The end date of your event, in YYYY-MM-DD format. Leave blank if you don't have a date yet.
Expand Down
7 changes: 5 additions & 2 deletions layouts/shortcodes/cfp_dates.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{{ $event := (print .Page.Params.year (lower .Page.Params.city)) }}
{{ $e := (index $.Page.Site.Data.events $event) }}
{{ $path := split .Page.Source.File.Path "/" }}
{{ $event_slug := index $path 1 }}
{{ $e := (index .Page.Site.Data.events $event_slug) }}

{{ if isset $e "cfp_date_start" }}

{{ $cfp_date_start := $e.cfp_date_start }}
{{ $cfp_date_end := $e.cfp_date_end }}
{{ $cfp_date_announce := $e.cfp_date_announce }}



<center>
<b>Call for proposals opens {{ dateFormat "Monday, Jan 2, 2006" $cfp_date_start }}.</b><br>
<b>Call for proposals closes {{ dateFormat "Monday, Jan 2, 2006" $cfp_date_end }}.</b><br>
Expand Down
8 changes: 3 additions & 5 deletions layouts/shortcodes/email_organizers.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{{ $event := (print .Page.Params.year (lower .Page.Params.city)) }}
{{ $e := (index $.Page.Site.Data.events $event) }}

{{ $cfp_date_start := $e.organizer_email }}

{{ $path := split .Page.Source.File.Path "/" }}
{{ $event_slug := index $path 1 }}
{{ $e := (index .Page.Site.Data.events $event_slug) }}
<a href='mailto:{{ $e.organizer_email }}'>{{ $e.organizer_email }}</a>
7 changes: 3 additions & 4 deletions layouts/shortcodes/email_proposals.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{ $event := (print .Page.Params.year (lower .Page.Params.city)) }}
{{ $e := (index $.Page.Site.Data.events $event) }}

{{ $cfp_date_start := $e.proposal_email }}
{{ $path := split .Page.Source.File.Path "/" }}
{{ $event_slug := index $path 1 }}
{{ $e := (index .Page.Site.Data.events $event_slug) }}

<a href='mailto:{{ $e.proposal_email }}'>{{ $e.proposal_email }}</a>
12 changes: 9 additions & 3 deletions layouts/shortcodes/event_end.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{{ $event := (print .Page.Params.year (lower .Page.Params.city)) }}
{{ $e := (index $.Page.Site.Data.events $event) }}
{{ $path := split .Page.Source.File.Path "/" }}
{{ $event_slug := index $path 1 }}
{{ $e := (index .Page.Site.Data.events $event_slug) }}
{{ $enddate := $e.enddate}}
{{ dateFormat "Monday, Jan 2, 2006" $enddate }}

{{ if isset $e "enddate" }}
{{ dateFormat "Monday, Jan 2, 2006" $enddate }}
{{ else }}
TBD
{{ end }}
5 changes: 4 additions & 1 deletion layouts/shortcodes/event_link.html
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
<a href = "/events/{{ .Page.Params.year }}-{{ lower .Page.Params.city }}/{{ .Get "page" }}">{{ .Get "text" }}</a>
{{ $path := split .Page.Source.File.Path "/" }}
{{ $event_slug := index $path 1 }}

<a href = "/events/{{ $event_slug }}/{{ .Get "page" }}">{{ .Get "text" }}</a>
7 changes: 4 additions & 3 deletions layouts/shortcodes/event_location.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ $event := (print .Page.Params.year (lower .Page.Params.city)) }}
{{ $e := (index $.Page.Site.Data.events $event) }}
<a href = "/events/{{ .Page.Params.year }}-{{ lower .Page.Params.city }}/location">{{ $e.location }}</a>
{{ $path := split .Page.Source.File.Path "/" }}
{{ $event_slug := index $path 1 }}
{{ $e := (index .Page.Site.Data.events $event_slug) }}
<a href = "/events/{{ $event_slug }}/location">{{ $e.location }}</a>
6 changes: 5 additions & 1 deletion layouts/shortcodes/event_logo.html
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
<img alt="DevOpsDays {{ .Page.Params.city }} {{ .Page.Params.year }}" src="/img/events/{{ .Page.Params.year }}-{{lower .Page.Params.city }}/logo.png"/>
{{ $path := split .Page.Source.File.Path "/" }}
{{ $event_slug := index $path 1 }}
{{ $e := (index .Page.Site.Data.events $event_slug) }}

<img alt="DevOpsDays {{ $e.city }} {{ $e.year }}" src="/img/events/{{ $event_slug }}/logo.png"/>
13 changes: 10 additions & 3 deletions layouts/shortcodes/event_start.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{{ $event := (print .Page.Params.year (lower .Page.Params.city)) }}
{{ $e := (index $.Page.Site.Data.events $event) }}
{{ $path := split .Page.Source.File.Path "/" }}
{{ $event_slug := index $path 1 }}
{{ $e := (index .Page.Site.Data.events $event_slug) }}

{{ $startdate := $e.startdate}}
{{ dateFormat "Monday, Jan 2, 2006" $startdate }}

{{ if isset $e "startdate" }}
{{ dateFormat "Monday, Jan 2, 2006" $startdate }}
{{ else }}
TBD
{{ end }}
5 changes: 3 additions & 2 deletions layouts/shortcodes/list_organizers.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{ $event := (print .Page.Params.year (lower .Page.Params.city)) }}
{{ $e := (index $.Page.Site.Data.events $event) }}
{{ $path := split .Page.Source.File.Path "/" }}
{{ $event_slug := index $path 1 }}
{{ $e := (index .Page.Site.Data.events $event_slug) }}
<ul>
{{ range $event_organizers := $e.team }}
<li>{{ $event_organizers }}</li>
Expand Down
14 changes: 12 additions & 2 deletions themes/devopsdays-legacy/layouts/event/single.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
{{ partial "header.html" . }}

{{/*
This section is what creates the query to get at all the site data. If you need this somewhere, you can just copy
it and paste it. Need to figure out if a partial would expose the variables/elements/array created herein. It could be done in a partial (need to include the trailing .) but I don't think it would work in shortcodes, which is where we need it the most - mattstratton
*/}}

{{ $path := split $.Source.File.Path "/" }}
{{ $event_slug := index $path 1 }}
{{ $event := (print .Params.year (lower .Params.city)) }}
{{ $e := (index $.Site.Data.events $event) }}
{{ $e := (index $.Site.Data.events $event_slug) }}

{{/* end site data query */}}

<div class = "container-fluid">
<div class="row">
<div class="col-md-8">
Expand All @@ -10,7 +20,7 @@ <h1> {{ $e.city }} - {{ title .Title }} </h1>
<div class="submenu">
<h3>
{{ range $navigation := $e.navigationelements}}
<a href="/events/{{ $e.friendly }}/{{ $navigation}}">{{ $navigation }}</a>&nbsp;
<a href="/events/{{ $event_slug }}/{{ $navigation}}">{{ $navigation }}</a>&nbsp;
{{ end }}
</h3>
</div>
Expand Down
3 changes: 3 additions & 0 deletions themes/devopsdays-legacy/layouts/partials/get-slug.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{ $path := split $.Source.File.Path "/" }}
{{ $event_slug := index $path 1 }}
{{ $event_slug }}

0 comments on commit b66c204

Please sign in to comment.