Skip to content
This repository has been archived by the owner on Jul 21, 2019. It is now read-only.

Commit

Permalink
Change homepage grid images#149 (#151)
Browse files Browse the repository at this point in the history
* Change grid to look for data file element

Signed-off-by: Matt Stratton <[email protected]>

* Update examplesite data with new data elements

Also add some sample square logos using jpg.

Signed-off-by: Matt Stratton <[email protected]>

* Update gulp to include jpg

Signed-off-by: Matt Stratton <[email protected]>
  • Loading branch information
mattstratton authored Jan 31, 2017
1 parent 0e4388d commit 8f06161
Show file tree
Hide file tree
Showing 38 changed files with 63 additions and 19 deletions.
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-amsterdam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ enddate: 2017-06-30
cfp_date_start: 2017-01-15 # start accepting talk proposals.
cfp_date_end: 2017-04-01 # close your call for proposals.
cfp_date_announce: 2017-05-15 # inform proposers of status
homepage_image: 'logo-square.jpg'


# Location
coordinates: "52.376862, 4.922078" # The coordinates of your city. Get Latitude and Longitude of a Point: http://itouchmap.com/latlong.html
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-atlanta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ enddate: 2017-04-19
cfp_date_start: 2017-01-05
cfp_date_end: 2017-02-27
cfp_date_announce: 2017-03-01
homepage_image: 'logo-square.jpg'


# Location
#
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-austin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ enddate: 2017-05-05
cfp_date_start: 2017-01-23
cfp_date_end: 2017-02-14
cfp_date_announce: 2017-03-01
homepage_image: 'logo-square.jpg'


# Location
#
Expand Down
1 change: 1 addition & 0 deletions exampleSite/data/events/2017-baltimore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ enddate: 2017-03-08
cfp_date_start: 2016-05-26
cfp_date_end: 2016-12-09
cfp_date_announce: 2017-01-06
homepage_image: 'logo-square.png'

# Location
coordinates: "39.286400, -76.605606" # The coordinates of your city. Get Latitude and Longitude of a Point: http://itouchmap.com/latlong.html
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-beijing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ enddate: 2017-03-18 # The end date of your event. Leave blank if you don't have
cfp_date_start: # start accepting talk proposals.
cfp_date_end: # close your call for proposals.
cfp_date_announce: # inform proposers of status
homepage_image: 'logo-square.jpg'


# Location
#
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-cape-town.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ enddate: 2017-11-07
cfp_date_start: 2017-02-01 # start accepting talk proposals.
cfp_date_end: 2017-04-30 # close your call for proposals.
cfp_date_announce: 2017-05-07 # inform proposers of status
homepage_image: ""


# Location
#
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-charlotte.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ enddate: 2017-02-07 # The end date of your event. Leave blank if you don't have
cfp_date_start: # start accepting talk proposals.
cfp_date_end: # close your call for proposals.
cfp_date_announce: # inform proposers of status
homepage_image: 'logo-square.png'


# Location
#
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-chicago.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ enddate: # The end date of your event. Leave blank if you don't have a venue re
cfp_date_start: # start accepting talk proposals.
cfp_date_end: # close your call for proposals.
cfp_date_announce: # inform proposers of status
homepage_image: 'logo-square.jpg'


# Location
#
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-denver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ cfp_date_end: 2017-02-17
cfp_date_announce: 2017-03-01
coordinates: "39.739236, -104.990251" # The corrodinates of your venue. Get Latitude and Longitude of a Point: http://itouchmap.com/latlong.html
location: "Denver" # The name of your location
homepage_image: 'logo-square.jpg'


nav_elements: # List of pages you want to show up in the navigation of your page.
- name: welcome
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-detroit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ enddate: 2017-09-28
cfp_date_start: # start accepting talk proposals.
cfp_date_end: # close your call for proposals.
cfp_date_announce: # inform proposers of status
homepage_image: 'logo-square.jpg'


# Location
#
Expand Down
1 change: 1 addition & 0 deletions exampleSite/data/events/2017-hoofington.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ cfp_date_end: 2016-12-30
cfp_date_announce: 2017-01-01
coordinates: "-22.242517, 25.859375"
location: "Hoofington Palace"
homepage_image: 'logo-square.png'
newnav: "yes"
# navigationelements: ["welcome", "contact", "location", "program", "propose", "proposals", "conduct", "sponsor"]
nav_elements:
Expand Down
1 change: 1 addition & 0 deletions exampleSite/data/events/2017-los-angeles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cfp_date_start: # start accepting talk proposals.
cfp_date_end: # close your call for proposals.
cfp_date_announce: # inform proposers of status


# Location
#
coordinates: "34.149276,-118.142252"
Expand Down
4 changes: 3 additions & 1 deletion exampleSite/data/events/2017-minneapolis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ enddate: 2017-07-26
cfp_date_start: 2016-12-22
cfp_date_end: 2017-04-09
cfp_date_announce: 2017-05-07
homepage_image: 'logo-square.jpg'


coordinates: "44.972610,-93.272960"
location: "Minneapolis"
Expand Down Expand Up @@ -47,7 +49,7 @@ proposal_email: "[email protected]"
sponsors:
- id: arresteddevops
level: community
- id: pivotal
- id: pivotal
level: platinum
- id: deis
level: silver
Expand Down
3 changes: 2 additions & 1 deletion exampleSite/data/events/2017-moscow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ enddate: 2017-03-11 # The end date of your event. Leave blank if you don't have
cfp_date_start: 2016-12-01 # start accepting talk proposals.
cfp_date_end: 2017-02-17 # close your call for proposals.
cfp_date_announce: 2017-02-17 # inform proposers of status
homepage_image: 'logo-square.png'


# Location
#
Expand Down Expand Up @@ -104,4 +106,3 @@ sponsor_levels:
label: Media
- id: community
label: Community

1 change: 1 addition & 0 deletions exampleSite/data/events/2017-ponyville.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cfp_date_announce: 2017-01-01
coordinates: "41.882219, -87.640530"
location: "Applejack House"
newnav: "yes"
homepage_image: 'logo-square.jpg'
# navigationelements: ["welcome", "contact", "location", "program", "propose", "proposals", "conduct", "sponsor"]
nav_elements:
- name: welcome
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-salt-lake-city.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ enddate: 2017-05-17 # The end date of your event. Leave blank if you don't have
cfp_date_start: 2016-12-14 # start accepting talk proposals.
cfp_date_end: 2017-02-15 # close your call for proposals.
cfp_date_announce: 2017-03-01 # inform proposers of status
homepage_image: 'logo-square.jpg'


# Location
#
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-seattle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ enddate: 2017-04-27 # The end date of your event. Leave blank if you don't have
cfp_date_start: 2016-10-24 # start accepting talk proposals.
cfp_date_end: 2017-01-24 # close your call for proposals.
cfp_date_announce: 2017-02-07 # inform proposers of status
homepage_image: 'logo-square.jpg'


# Location
#
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-stockholm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ enddate: 2017-05-09 # The end date of your event. Leave blank if you don't have
cfp_date_start: # start accepting talk proposals.
cfp_date_end: # close your call for proposals.
cfp_date_announce: # inform proposers of status
homepage_image: 'logo-square.jpg'


# Location
#
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-toronto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ enddate: 2017-05-26 # The end date of your event. Leave blank if you don't have
cfp_date_start: 2016-12-21 # start accepting talk proposals.
cfp_date_end: 2017-01-31 # close your call for proposals.
cfp_date_announce: 2017-02-28 # inform proposers of status
homepage_image: 'logo-square.jpg'


# Location
#
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-vancouver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ enddate: 2017-04-01 # The end date of your event. Leave blank if you don't have
cfp_date_start: 2016-12-01 # start accepting talk proposals.
cfp_date_end: 2017-02-01 # close your call for proposals.
cfp_date_announce: 2017-02-11 # inform proposers of status
homepage_image: 'logo-square.jpg'


# Location
#
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/data/events/2017-zurich.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ enddate: 2017-05-04
cfp_date_start: 2016-11-01 # start accepting talk proposals.
cfp_date_end: 2017-02-01 # close your call for proposals.
cfp_date_announce: 2017-04-01 # inform proposers of status
homepage_image: 'logo-square.jpg'


# Location
#
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion gulp/tasks/responsive-images.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ var gulp = require('gulp'),
responsive = require('gulp-responsive');

gulp.task('responsive-images', function() {
return gulp.src(['public/**/*.png', '!public/favicon*', '!public/apple-icon*', '!public/android-icon*', '!public/ms-icon*'])
return gulp.src(['public/**/*.png', 'public/**/*.jpg',
'!public/favicon*', '!public/apple-icon*', '!public/android-icon*', '!public/ms-icon*'
])
.pipe(responsive({
// produce multiple images from one source
'**/*.png': [{
Expand All @@ -17,13 +19,28 @@ gulp.task('responsive-images', function() {
rename: {
suffix: '@3x'
}
}],
'**/*.jpg': [{
width: '50%'
}, {
width: '100%',
rename: {
suffix: '@2x'
}
}, {
width: '150%',
rename: {
suffix: '@3x'
}
}]
}, {
// global configuration
quality: 80,
errorOnEnlargement: false,
withoutEnlargement: false,
progressive: true,
silent: true,
witheMetadate: false,
}))
.pipe(gulp.dest('staging'));
});
22 changes: 6 additions & 16 deletions layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,19 @@
</div>
</div>
</div>

{{ $.Scratch.Add "i" 1 }}
<div class="row">
{{- range sort $.Site.Data.events "startdate" -}}
{{- if .startdate -}}
{{- if ge (dateFormat "2006-01-02" .startdate) (dateFormat "2006-01-02" ($.Now.Format "2006-01-02")) -}}
{{ $.Scratch.Set "city" .city }}
{{ $.Scratch.Set "year" .year }}
{{ $.Scratch.Set "logo" "unset" }}
<div class="col-md-3 homepage-grid-col">
<a href = "/events/{{ .name }}">
{{ $.Scratch.Set "subdir" .name }}
{{ $.Scratch.Set "contentdir" (printf "static/events/%s/" ($.Scratch.Get "subdir")) }}
{{- range (readDir "static/events") -}}
{{- if eq .Name ($.Scratch.Get "subdir") -}}
{{- range (readDir ($.Scratch.Get "contentdir")) -}}
{{- if eq .Name "logo-square.png" -}}
<img src="{{ printf ("/events/%s/logo-square.png") ($.Scratch.Get "subdir")}}" class="img-fluid"/>
{{ $.Scratch.Set "logo" "set" }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- if ne ($.Scratch.Get "logo") "set" -}}
{{- if .homepage_image }}
{{- if ne .homepage_image "" }}
<img src = "/events/{{ .name }}/{{ .homepage_image }}" class="img-fluid"/>
{{- end -}}
{{- else -}}
<img src="/img/event-logo-default.png" class="img-fluid"/>
{{- end -}}
</a>
Expand Down

0 comments on commit 8f06161

Please sign in to comment.