diff --git a/exampleSite/data/events/2017-ponyville.yml b/exampleSite/data/events/2017-ponyville.yml index 2648c5af1..865a1d8bc 100644 --- a/exampleSite/data/events/2017-ponyville.yml +++ b/exampleSite/data/events/2017-ponyville.yml @@ -13,6 +13,10 @@ location: "Applejack House" newnav: "yes" event_logo_square: 'logo-square.jpg' event_twitter: "mattstratton" +registration_open: "true" +registration_link: "" +cfp_open: "true" +cfp_link: "" # navigationelements: ["welcome", "contact", "location", "program", "propose", "proposals", "conduct", "sponsor"] nav_elements: @@ -21,7 +25,7 @@ nav_elements: # url: http://cfp.devopsdayschi.org - name: program - name: speakers - # - name: registration + - name: registration - name: sponsor - name: volunteer - name: location diff --git a/layouts/partials/events/cta.html b/layouts/partials/events/cta.html new file mode 100644 index 000000000..b38d88fda --- /dev/null +++ b/layouts/partials/events/cta.html @@ -0,0 +1,47 @@ +{{/* site data query copypasta */}} +{{ $path := split $.Source.File.Path .Site.Params.pathseperator }} +{{ $event_slug := index $path 1 }} +{{ $e := (index $.Site.Data.events $event_slug) }} +{{/* end site data query */}} + +{{ if $e.registration_open }} + {{ if eq $e.registration_open "true" }} + {{ if $e.registration_link }} + {{ if eq $e.registration_link "" }} + {{ $.Scratch.Set "registration_link" (printf "/events/%s/register" $event_slug)}} + {{ else }} + {{ $.Scratch.Set "registration_link" $e.registration_link }} + {{ end }} + {{ else }} + {{ $.Scratch.Set "registration_link" (printf "/events/%s/register" $event_slug)}} + + {{ end }} + Register + {{ end }} +{{ end }} + + + +{{ if $e.cfp_open }} + {{ if eq $e.cfp_open "true" }} + {{ if $e.cfp_link }} + {{ if eq $e.cfp_link "" }} + {{ $.Scratch.Set "cfp_link" (printf "/events/%s/propose" $event_slug)}} + {{ else }} + {{ $.Scratch.Set "cfp_link" $e.cfp_link }} + {{ end }} + {{ else }} + {{ $.Scratch.Set "cfp_link" (printf "/events/%s/propose" $event_slug)}} + + {{ end }} + Propose + {{ end }} +{{ end }} + + +{{ if $e.event_twitter }} + {{ if ne $e.event.twitter "" }} + Follow + {{ end }} +{{ end }} +
diff --git a/layouts/partials/welcome.html b/layouts/partials/welcome.html index 330fdf086..67c08bf81 100644 --- a/layouts/partials/welcome.html +++ b/layouts/partials/welcome.html @@ -36,9 +36,7 @@

DevOpsDays {{ $e.city }}

{{- end -}}
{{ end }} - - -
+ {{ partial "events/cta.html" . }}