Skip to content

Commit ad7eedb

Browse files
committed
city nesting of json.
1 parent a53969a commit ad7eedb

File tree

2 files changed

+32
-20
lines changed

2 files changed

+32
-20
lines changed

main.js

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,44 @@ var fs = require('fs');
22
var handlebars = require('handlebars');
33
var _ = require('underscore');
44

5-
var speakers = [
5+
var cities = [
66
{
7-
name: "Justin Abrahms"
8-
, location: "Portland, OR"
9-
, twitter: "@justinabrahms"
10-
, github: "justinabrahms"
11-
, preferred_audience_size: "any"
12-
, travel_availability: "if comped"
13-
}
14-
, {
15-
name: "Christopher Swenson"
16-
, location: "Portland, OR"
17-
, twitter: "@caswenson"
18-
, github: "caswenson"
19-
, preferred_audience_size: "large"
20-
, travel_availability: "local"
7+
city: "Portland, OR",
8+
speakers: [
9+
{
10+
name: "Justin Abrahms"
11+
, location: "Portland, OR"
12+
, twitter: "@justinabrahms"
13+
, github: "justinabrahms"
14+
, preferred_audience_size: "any"
15+
, travel_availability: "if comped"
16+
}
17+
, {
18+
name: "Christopher Swenson"
19+
, location: "Portland, OR"
20+
, twitter: "@caswenson"
21+
, github: "caswenson"
22+
, preferred_audience_size: "large"
23+
, travel_availability: "local"
24+
}
25+
]
2126
}
2227
, {
28+
city: "San Francisco, CA"
29+
, speakers: [{
2330
name: "Jason Denizac"
2431
, location: "San Fancisco, CA"
2532
, twitter: "@_jden"
2633
, github: "jden"
2734
, preferred_audience_size: "small"
2835
, travel_availability: "any"
29-
}
36+
}]
37+
}
3038
];
3139

3240
function get_speakers() {
3341
return {
34-
speakers: speakers
42+
cities: cities
3543
};
3644
};
3745

templates/speakers.hbs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
{{#speakers}}
2-
Name:{{name}}
3-
{{/speakers}}
1+
{{#cities}}
2+
City: {{city}}
3+
4+
{{#speakers}}
5+
Name:{{name}}
6+
{{/speakers}}
7+
{{/cities}}

0 commit comments

Comments
 (0)