From 7cbc1202fcf2c5e51e149d0d1e6e5aa40894222e Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Tue, 19 May 2015 09:10:40 -0600 Subject: [PATCH 1/2] Making progress --- .gitignore | 2 ++ episodes/2014-11-14/data.hson | 12 +++++++++ includes/icon.jade | 4 +++ includes/person.jade | 6 +++++ index.html | 2 +- index.jade | 50 +++++++++++++++++++++++++++++++++++ package.json | 29 ++++++++++++++++++++ scripts/build.js | 28 ++++++++++++++++++++ scripts/google-analytics.js | 15 +++++++++++ scripts/locals.hson | 22 +++++++++++++++ styles.css | 8 +++++- 11 files changed, 176 insertions(+), 2 deletions(-) create mode 100644 .gitignore create mode 100644 episodes/2014-11-14/data.hson create mode 100644 includes/icon.jade create mode 100644 includes/person.jade create mode 100644 index.jade create mode 100644 package.json create mode 100644 scripts/build.js create mode 100644 scripts/google-analytics.js create mode 100644 scripts/locals.hson diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de4d1f0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dist +node_modules diff --git a/episodes/2014-11-14/data.hson b/episodes/2014-11-14/data.hson new file mode 100644 index 0000000..26b1023 --- /dev/null +++ b/episodes/2014-11-14/data.hson @@ -0,0 +1,12 @@ +{ + title: 'The Angular Team on 1.3 & 2.0', + datetime: '2014-11-14 16:00', + timezone: 'America/Los_Angeles', + hangoutId: 'c2182d3bec32vs4jim7r8smc1q4', + guests: [ + {name: 'Bradly Green', twitter: 'bradlygreen'}, + {name: 'Miško Hevery', twitter: 'mhevery'} + {name: 'Igor Minar', twitter: 'IgorMinar'}, + {name: 'Pete Bacon Darwin', twitter: 'petebd'} + ] +} diff --git a/includes/icon.jade b/includes/icon.jade new file mode 100644 index 0000000..6df4090 --- /dev/null +++ b/includes/icon.jade @@ -0,0 +1,4 @@ +mixin icon(data) + div.link-icon + a(href="#{data.link}",title="#{data.title}") + i(class="fa fa-#{data.icon}") diff --git a/includes/person.jade b/includes/person.jade new file mode 100644 index 0000000..3b7a229 --- /dev/null +++ b/includes/person.jade @@ -0,0 +1,6 @@ +mixin person(data) + a(href="https://twitter.com/#{data.twitter}") + img(src="#{data.avatar}",class=(data.noCircle ? 'no-circle' : ''),alt="#{data.name} Profile Picture") + span.person__name + span.person__name__name #{data.name} + small.person__name__twitter @#{data.twitter} diff --git a/index.html b/index.html index 10d6f8e..cbd493c 100644 --- a/index.html +++ b/index.html @@ -12,7 +12,7 @@ Google+ -
+

Loading Angular Air...

diff --git a/index.jade b/index.jade new file mode 100644 index 0000000..42660cf --- /dev/null +++ b/index.jade @@ -0,0 +1,50 @@ +include includes/person +include includes/icon + +doctype html +html + head(lang="en") + meta(charset="UTF-8") + meta(name="viewport", content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no") + link(rel="shortcut icon", type="image/png", href="http://github.com/favicon.png") + title Angular Air + style. + .\+hide-without-styles {display:none} + body + a(style="display:none",aria-hidden,href="https://plus.google.com/104335210120652090229",rel="publisher") Google+ + div(class="+show-without-styles",style="margin-top:80px;margin-bottom:80px;text-align:center;") + h1 Loading Angular Air... + div(id="content" class="+hide-without-styles --show") + div(id="logo" class="center") + img(src="http://github.com/logo.png") + section(id="title" class="center") + h1 Angular Air + h2 + | Angular video podcast hosted by + | #{host.name} + + div(class="big-gap") + + section(id="host" class="clearfix") + div.host + mixin person(host) + section#description.center + p.center + | Angular Air is a live video podcast all about Angular + br + | hosted by egghead.io instructor Kent C. Dodds + + hr + + section.center(id="podcast-links") + each i in subscriptionIcons + mixin icon(i) + + + + link(rel="stylesheet", href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css") + link(rel="stylesheet", href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css") + style + include styles.css + script + include scripts/google-analytics.js diff --git a/package.json b/package.json new file mode 100644 index 0000000..1da93bc --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "angular-air-website", + "version": "1.0.0", + "description": "angular-air.com", + "main": "scripts/start.js", + "scripts": { + "start": "nodemon -w episodes -w includes -w index.jade -w styles.css -w panel -w scripts scripts/build.js", + "build:jade": "jade -P -O options.json -o dist index.jade", + "build": "rm -rf dist && mkdir dist && node scripts/build && cp -a {favicon.png,CNAME,logo.png,kentcdodds.png,episodes} dist/", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "https://github.com/ng-air/ng-air.github.io.git" + }, + "author": "Kent C. Dodds ", + "license": "MIT", + "bugs": { + "url": "https://github.com/ng-air/ng-air.github.io/issues" + }, + "homepage": "https://github.com/ng-air/ng-air.github.io", + "devDependencies": { + "hanson": "^1.1.1", + "jade": "^1.9.2", + "moment": "^2.10.3", + "moment-timezone": "^0.3.1", + "nodemon": "^1.3.7" + } +} diff --git a/scripts/build.js b/scripts/build.js new file mode 100644 index 0000000..24d821e --- /dev/null +++ b/scripts/build.js @@ -0,0 +1,28 @@ +var fs = require('fs'); +var path = require('path'); + +var moment = require('moment-timezone'); +var hson = require('hanson'); +var jade = require('jade'); + +compileIndex(); + + +function compileIndex() { + var indexFilename = here('../index.jade'); + var index = fs.readFileSync(indexFilename, 'utf-8'); + var localsHson = fs.readFileSync(here('./locals.hson'), 'utf-8'); + var locals = hson.parse(localsHson); + alterLocals(locals); + var fn = jade.compile(index, {pretty: true, filename: indexFilename}); + var result = fn(locals); + fs.writeFileSync(here('../dist/index.html'), result); +} + +function alterLocals(locals) { + return locals; +} + +function here(dest) { + return path.resolve(__dirname, dest); +} diff --git a/scripts/google-analytics.js b/scripts/google-analytics.js new file mode 100644 index 0000000..fb6beb3 --- /dev/null +++ b/scripts/google-analytics.js @@ -0,0 +1,15 @@ +(function (i, s, o, g, r, a, m) { + i['GoogleAnalyticsObject'] = r; + i[r] = i[r] || function () { + (i[r].q = i[r].q || []).push(arguments) + }, i[r].l = 1 * new Date(); + a = s.createElement(o), + m = s.getElementsByTagName(o)[0]; + a.async = 1; + a.src = g; + m.parentNode.insertBefore(a, m) +})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); + +ga('create', 'UA-56527541-1', 'auto'); +ga('require', 'displayfeatures'); +ga('send', 'pageview'); diff --git a/scripts/locals.hson b/scripts/locals.hson new file mode 100644 index 0000000..ae33a8f --- /dev/null +++ b/scripts/locals.hson @@ -0,0 +1,22 @@ +{ + host: { + name: 'Kent C. Dodds', + twitter: 'kentcdodds', + avatar: 'kentcdodds.png' + }, + panelists: [ + {name: 'Olivier Combe', twitter: 'ocombe'}, + {name: 'Kara Erickson', twitter: 'karaforthewin'}, + {name: 'Aimee Knight', twitter: 'Aimee_Knight'}, + {name: 'Scott Moss', twitter: 'scotups'}, + {name: 'Todd Motto', twitter: 'toddmotto'}, + {name: 'Pascal Precht', twitter: 'PascalPrecht'}, + {name: 'Carmen Popoviciu', twitter: 'CarmenPopoviciu'}, + {name: 'Patrick Stapleton', twitter: 'gdi2290'} + ], + subscriptionIcons: [ + {icon: 'apple', title: 'Subscribe on iTunes', link: 'https://itunes.apple.com/us/podcast/angular-air/id940806858?mt=2'}, + {icon: 'youtube', title: 'Subscribe on YouTube', link: 'https://www.youtube.com/c/AngularAirPodcast'}, + {icon: 'rss', title: 'Subscribe on RSS', link: 'http://angularair.podbean.com/feed/'} + ] +} diff --git a/styles.css b/styles.css index 682b433..21bdc9c 100644 --- a/styles.css +++ b/styles.css @@ -1,4 +1,10 @@ - +/*now that styles are loading, switch these*/ +.\+hide-without-styles.\--show { + display: block; +} +.\+show-without-styles { + display: none; +} /* phone */ @media only screen and (max-width: 767px) { From b9b691151ca53a308e515d7ad5e78191b81c0d6a Mon Sep 17 00:00:00 2001 From: "Kent C. Dodds" Date: Wed, 20 May 2015 08:53:17 -0600 Subject: [PATCH 2/2] Further progress made --- episodes/2014-11-14/data.hson | 7 ++- episodes/2014-12-02/data.hson | 8 ++++ episodes/2014-12-16/data.hson | 10 ++++ episodes/2015-01-13/data.hson | 10 ++++ episodes/2015-01-27/data.hson | 11 +++++ episodes/2015-02-13/data.hson | 9 ++++ episodes/2015-03-17/data.hson | 10 ++++ episodes/2015-03-24/data.hson | 8 ++++ episodes/2015-03-31/data.hson | 10 ++++ episodes/2015-04-07/data.hson | 8 ++++ episodes/2015-04-14/data.hson | 9 ++++ episodes/2015-04-21/data.hson | 12 +++++ episodes/2015-04-28/data.hson | 9 ++++ episodes/2015-05-05/data.hson | 9 ++++ episodes/2015-05-12/data.hson | 10 ++++ episodes/2015-05-19/data.hson | 8 ++++ includes/episode.jade | 22 +++++++++ includes/icon.jade | 2 +- includes/person-group.jade | 8 ++++ index.jade | 39 ++++++++++++--- package.json | 3 +- scripts/build.js | 89 ++++++++++++++++++++++++++++++++++- styles.css | 42 ++++++++++++++++- 23 files changed, 336 insertions(+), 17 deletions(-) create mode 100644 episodes/2014-12-02/data.hson create mode 100644 episodes/2014-12-16/data.hson create mode 100644 episodes/2015-01-13/data.hson create mode 100644 episodes/2015-01-27/data.hson create mode 100644 episodes/2015-02-13/data.hson create mode 100644 episodes/2015-03-17/data.hson create mode 100644 episodes/2015-03-24/data.hson create mode 100644 episodes/2015-03-31/data.hson create mode 100644 episodes/2015-04-07/data.hson create mode 100644 episodes/2015-04-14/data.hson create mode 100644 episodes/2015-04-21/data.hson create mode 100644 episodes/2015-04-28/data.hson create mode 100644 episodes/2015-05-05/data.hson create mode 100644 episodes/2015-05-12/data.hson create mode 100644 episodes/2015-05-19/data.hson create mode 100644 includes/episode.jade create mode 100644 includes/person-group.jade diff --git a/episodes/2014-11-14/data.hson b/episodes/2014-11-14/data.hson index 26b1023..bb666a9 100644 --- a/episodes/2014-11-14/data.hson +++ b/episodes/2014-11-14/data.hson @@ -1,11 +1,10 @@ { title: 'The Angular Team on 1.3 & 2.0', - datetime: '2014-11-14 16:00', - timezone: 'America/Los_Angeles', - hangoutId: 'c2182d3bec32vs4jim7r8smc1q4', + dateTime: '2015-11-14 14:00', + hangoutUrl: 'https://plus.google.com/u/0/events/c2182d3bec32vs4jim7r8smc1q4', guests: [ {name: 'Bradly Green', twitter: 'bradlygreen'}, - {name: 'Miško Hevery', twitter: 'mhevery'} + {name: 'Miško Hevery', twitter: 'mhevery'}, {name: 'Igor Minar', twitter: 'IgorMinar'}, {name: 'Pete Bacon Darwin', twitter: 'petebd'} ] diff --git a/episodes/2014-12-02/data.hson b/episodes/2014-12-02/data.hson new file mode 100644 index 0000000..09d3c82 --- /dev/null +++ b/episodes/2014-12-02/data.hson @@ -0,0 +1,8 @@ +{ + title: 'Hitting the Ground Running with Angular', + dateTime: '2014-12-02 11:00', + hangoutUrl: 'https://plus.google.com/u/0/events/cg90utbgkqg89fg43k62kav02v4', + guests: [ + {name: 'John Lindquist', twitter: 'johnlindquist'} + ] +} diff --git a/episodes/2014-12-16/data.hson b/episodes/2014-12-16/data.hson new file mode 100644 index 0000000..b63ee59 --- /dev/null +++ b/episodes/2014-12-16/data.hson @@ -0,0 +1,10 @@ +{ + title: 'Angular DevTools', + hangoutUrl: 'https://plus.google.com/events/c6hntmhpemnkna04svmer2jnca8', + guests: [ + {name: 'Brian Ford', twitter: 'briantford'} + ], + sponsors: [ + {name: 'ShirtJS', website: 'http://shirtjs.com/'} + ] +} diff --git a/episodes/2015-01-13/data.hson b/episodes/2015-01-13/data.hson new file mode 100644 index 0000000..51ade81 --- /dev/null +++ b/episodes/2015-01-13/data.hson @@ -0,0 +1,10 @@ +{ + title: 'Staying up with AngularJS', + hangoutUrl: 'https://plus.google.com/events/cue886f2907d6l1avj1o2159j68', + guests: [ + {name: 'Air Lerner', twitter: 'auser'} + ], + sponsors: [ + {name: 'ReactWeek', website: 'http://reactweek.com/', noCircle: true} + ] +} diff --git a/episodes/2015-01-27/data.hson b/episodes/2015-01-27/data.hson new file mode 100644 index 0000000..8a22aa3 --- /dev/null +++ b/episodes/2015-01-27/data.hson @@ -0,0 +1,11 @@ +{ + title: 'Angular Community and Organizing ng-conf', + hangoutUrl: 'https://plus.google.com/events/cto0heinllidfpqqtmlvputrvlg', + guests: [ + {name: 'Joe Eames', twitter: 'josepheames'}, + {name: 'Aaron Frost', twitter: 'js_dev'}, + {name: 'Kip Lawrence', twitter: 'mightykip'}, + {name: 'Dave Geddes', twitter: 'geddski'}, + {name: 'Merrick Christensen', twitter: 'iammerrick'} + ] +} diff --git a/episodes/2015-02-13/data.hson b/episodes/2015-02-13/data.hson new file mode 100644 index 0000000..1380685 --- /dev/null +++ b/episodes/2015-02-13/data.hson @@ -0,0 +1,9 @@ +{ + title: 'On-site ng-nl broadcast', + dateTime: '2015-02-13 12:30', + timezone: 'CET', + hangoutUrl: 'https://plus.google.com/events/c1iuqnqrrbumg08vrmgk6fpmeao', + guests: [ + {name: 'NG-NL', twitter: 'ngnlconf', noCircle: true} + ] +} diff --git a/episodes/2015-03-17/data.hson b/episodes/2015-03-17/data.hson new file mode 100644 index 0000000..c532b6f --- /dev/null +++ b/episodes/2015-03-17/data.hson @@ -0,0 +1,10 @@ +{ + title: 'Ionic Framework', + hangoutUrl: 'https://plus.google.com/events/cmhq7mqarkoful8u7iusbjsdjtk', + guests: [ + {name: 'Adam Bradley', twitter: 'adamdbradley'}, + {name: 'Mike Hartington', twitter: 'mhartington'}, + {name: 'Max Lynch', twitter: 'maxlynch'}, + {name: 'Ben Sperry', twitter: 'benjsperry'} + ] +} diff --git a/episodes/2015-03-24/data.hson b/episodes/2015-03-24/data.hson new file mode 100644 index 0000000..802d9c5 --- /dev/null +++ b/episodes/2015-03-24/data.hson @@ -0,0 +1,8 @@ +{ + title: 'Developing Open Source Angular Libraries', + hangoutUrl: 'https://plus.google.com/events/c8vsorqvlsoi4r12m60l0fs22c4', + guests: [ + {name: 'Jason Dobry', twitter: 'jmdobry'}, + {name: 'Olivier Combe', twitter: 'OCombe'} + ] +} diff --git a/episodes/2015-03-31/data.hson b/episodes/2015-03-31/data.hson new file mode 100644 index 0000000..b33290e --- /dev/null +++ b/episodes/2015-03-31/data.hson @@ -0,0 +1,10 @@ +{ + title: 'i18n with Angular', + hangoutUrl: 'https://plus.google.com/events/cpn5hnihfuh175tbtbe3i75msgc', + guests: [ + [ + {name: 'Pascal Precht', twitter: 'PascalPrecht'}, + {name: 'Chirayu Krishnappa', twitter: 'chirayuk'} + ] + ] +} diff --git a/episodes/2015-04-07/data.hson b/episodes/2015-04-07/data.hson new file mode 100644 index 0000000..5597e8e --- /dev/null +++ b/episodes/2015-04-07/data.hson @@ -0,0 +1,8 @@ +{ + title: 'Contributing to Angular', + hangoutUrl: 'https://plus.google.com/events/cmoqjb7tmeaai8ugc5i2j81fpm8', + guests: [ + {name: 'Pawel Kozolowski', twitter: 'pkozlowski_os'}, + {name: 'Rodric Haddad', twitter: 'rodyhaddad'} + ] +} diff --git a/episodes/2015-04-14/data.hson b/episodes/2015-04-14/data.hson new file mode 100644 index 0000000..1f3be5e --- /dev/null +++ b/episodes/2015-04-14/data.hson @@ -0,0 +1,9 @@ +{ + title: 'Testing with Angular', + hangoutUrl: 'https://plus.google.com/events/cb42tejb88eliamj65o2ogh12qo', + guests: [ + {name: 'Andres Dominguez', twitter: 'andresdom'}, + {name: 'Julie Ralph', twitter: 'SomeJulie'}, + {name: 'Zan Thrash', twitter: 'zanthrash'} + ] +} diff --git a/episodes/2015-04-21/data.hson b/episodes/2015-04-21/data.hson new file mode 100644 index 0000000..4b24e58 --- /dev/null +++ b/episodes/2015-04-21/data.hson @@ -0,0 +1,12 @@ +{ + title: 'Introducing the Angular Air Panel', + hangoutUrl: 'https://plus.google.com/events/ckq1tk7s4h3dk97n0co8jst305s', + guests: [ + {name: 'Olivier Combe', twitter: 'ocombe', avatar: 'panel/ocombe.png'}, + {name: 'Kara Erickson', twitter: 'karaforthewin', avatar: 'panel/karaforthewin.png'}, + {name: 'Aimee Knight', twitter: 'Aimee_Knight', avatar: 'panel/Aimee_Knight.png'}, + {name: 'Scott Moss', twitter: 'scotups', avatar: 'panel/scotups.png'}, + {name: 'Pascal Precht', twitter: 'PascalPrecht', avatar: 'panel/PascalPrecht.png'}, + {name: 'Carmen Popoviciu', twitter: 'CarmenPopoviciu', avatar: 'panel/CarmenPopoviciu.png'} + ] +} diff --git a/episodes/2015-04-28/data.hson b/episodes/2015-04-28/data.hson new file mode 100644 index 0000000..3d8d28c --- /dev/null +++ b/episodes/2015-04-28/data.hson @@ -0,0 +1,9 @@ +{ + title: 'Angular 2 Alpha', + hangoutUrl: 'https://plus.google.com/events/cpa0ojla7fkk8mfi6h0e0gm2ejo', + guests: [ + {name: 'Jeff Whelpley', twitter: 'jeffwhelpley'}, + {name: 'Patrick Stapleton', twitter: 'gdi2290'}, + {name: 'Rob Wormald', twitter: 'robwormald'} + ] +} diff --git a/episodes/2015-05-05/data.hson b/episodes/2015-05-05/data.hson new file mode 100644 index 0000000..7b30bbe --- /dev/null +++ b/episodes/2015-05-05/data.hson @@ -0,0 +1,9 @@ +{ + title: 'Angular and Firebase', + hangoutUrl: 'https://plus.google.com/events/ctgocfv62l6lj1gj1ijus0hfl20', + guests: [ + {name: 'David East', twitter: '_davideast', avatar: 'episodes/2015-05-05/davideast.png'}, + {name: 'Jacob Wenger', twitter: '_jwngr', avatar: 'episodes/2015-05-05/jwngr.png'}, + {name: 'Kato Richardson', twitter: 'katowulf'} + ] +} diff --git a/episodes/2015-05-12/data.hson b/episodes/2015-05-12/data.hson new file mode 100644 index 0000000..c024c85 --- /dev/null +++ b/episodes/2015-05-12/data.hson @@ -0,0 +1,10 @@ +{ + title: 'Angular Apps, JavaScript, and Search Optimization', + hangoutUrl: 'https://plus.google.com/events/ci85lav8bdnjl356n5o0fkegb44', + guests: [ + {name: 'Adam Audette', twitter: 'audette'}, + {name: 'John Mueller', twitter: 'johnmu'}, + {name: 'Jody J. O\'Donnell', twitter: 'gimpslice'}, + {name: 'Max Prin', twitter: 'maxxeight'} + ] +} diff --git a/episodes/2015-05-19/data.hson b/episodes/2015-05-19/data.hson new file mode 100644 index 0000000..326bc78 --- /dev/null +++ b/episodes/2015-05-19/data.hson @@ -0,0 +1,8 @@ +{ + title: 'Architecting huge Angular apps', + hangoutUrl: 'https://plus.google.com/events/c7f6uq69p09v6jdvb0635pf7hok', + guests: [ + {name: 'Aaron Frost', twitter: 'js_dev'}, + {name: 'Ben Nadel', twitter: 'BenNadel'} + ] +} diff --git a/includes/episode.jade b/includes/episode.jade new file mode 100644 index 0000000..92c71e1 --- /dev/null +++ b/includes/episode.jade @@ -0,0 +1,22 @@ +include person-group + +mixin episode(e) + .main-episode-content + h3.episode__title + a(href="#{e.hangoutUrl}") #{e.title} + br + small #{e.displayDate} + + .hangouts-url + if (e.hangoutUrl) + | Sign up here to watch live! + else + | Stay tuned for a hangouts link + person-group(groups="e.guests") + .episode__description.justify + :markdown + #{e.description} + .episode__sponsors(ng-if="e.sponsors.length") + h4 Episode Sponsor{{e.sponsors.length > 1 ? 's' : ''} + person-group(groups="e.sponsors") + .episode__description.justify(ng-bind-html="e.sponsorship") diff --git a/includes/icon.jade b/includes/icon.jade index 6df4090..0aa58d8 100644 --- a/includes/icon.jade +++ b/includes/icon.jade @@ -1,4 +1,4 @@ mixin icon(data) - div.link-icon + .link-icon a(href="#{data.link}",title="#{data.title}") i(class="fa fa-#{data.icon}") diff --git a/includes/person-group.jade b/includes/person-group.jade new file mode 100644 index 0000000..abfa71f --- /dev/null +++ b/includes/person-group.jade @@ -0,0 +1,8 @@ +include person + +mixin person-group(groups) + each group in groups + .group.center.clearfix(class="group-#{group.length}") + each i in group + .person + mixin person(i) diff --git a/index.jade b/index.jade index 42660cf..fe3f2e5 100644 --- a/index.jade +++ b/index.jade @@ -1,5 +1,7 @@ include includes/person include includes/icon +include includes/person-group +include includes/episode doctype html html @@ -9,23 +11,23 @@ html link(rel="shortcut icon", type="image/png", href="http://github.com/favicon.png") title Angular Air style. - .\+hide-without-styles {display:none} + .hide-without-styles {display:none} body a(style="display:none",aria-hidden,href="https://plus.google.com/104335210120652090229",rel="publisher") Google+ - div(class="+show-without-styles",style="margin-top:80px;margin-bottom:80px;text-align:center;") + .show-without-styles(style="margin-top:80px;margin-bottom:80px;text-align:center;") h1 Loading Angular Air... - div(id="content" class="+hide-without-styles --show") - div(id="logo" class="center") + #content.hide-without-styles.show + .center(id="logo") img(src="http://github.com/logo.png") - section(id="title" class="center") + section#title.center h1 Angular Air h2 | Angular video podcast hosted by | #{host.name} - div(class="big-gap") + .big-gap - section(id="host" class="clearfix") + section.clearfix#host div.host mixin person(host) section#description.center @@ -40,7 +42,30 @@ html each i in subscriptionIcons mixin icon(i) + hr + section#panelists + h2 Panelists + mixin person-group(panelists) + hr + section#episodes + h2 Episodes + .episode + each e in episodes + mixin episode(e) + + section#past-episodes.episode + h2 Past Episodes + ul + each e, eIndex in pastEpisodes + li + a(href="#{e.hangoutUrl}") Episode #{eIndex}: #{e.title} + if (e.sponsors) + small + |  Sponsored by:  + each sponsor, sIndex in e.sponsors + span + a(href="#{sponsor.website}") #{sponsor.name} link(rel="stylesheet", href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css") link(rel="stylesheet", href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css") diff --git a/package.json b/package.json index 1da93bc..4401c56 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "scripts": { "start": "nodemon -w episodes -w includes -w index.jade -w styles.css -w panel -w scripts scripts/build.js", "build:jade": "jade -P -O options.json -o dist index.jade", - "build": "rm -rf dist && mkdir dist && node scripts/build && cp -a {favicon.png,CNAME,logo.png,kentcdodds.png,episodes} dist/", + "build": "rm -rf dist && mkdir dist && node scripts/build && cp -a {favicon.png,CNAME,panel,logo.png,kentcdodds.png,episodes} dist/", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { @@ -22,6 +22,7 @@ "devDependencies": { "hanson": "^1.1.1", "jade": "^1.9.2", + "lodash": "^3.9.1", "moment": "^2.10.3", "moment-timezone": "^0.3.1", "nodemon": "^1.3.7" diff --git a/scripts/build.js b/scripts/build.js index 24d821e..dec33f5 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -1,6 +1,7 @@ var fs = require('fs'); var path = require('path'); +var _ = require('lodash'); var moment = require('moment-timezone'); var hson = require('hanson'); var jade = require('jade'); @@ -11,18 +12,102 @@ compileIndex(); function compileIndex() { var indexFilename = here('../index.jade'); var index = fs.readFileSync(indexFilename, 'utf-8'); - var localsHson = fs.readFileSync(here('./locals.hson'), 'utf-8'); - var locals = hson.parse(localsHson); + var locals = getDataFromHson('./locals.hson'); alterLocals(locals); + locals = _.merge(locals, getEpisodeLocals()); var fn = jade.compile(index, {pretty: true, filename: indexFilename}); var result = fn(locals); fs.writeFileSync(here('../dist/index.html'), result); } + function alterLocals(locals) { + _.each(locals.panelists, function(panelist) { + panelist.avatar = panelist.avatar || 'panel/' + panelist.twitter + '.png'; + }); + locals.panelists = smartChunk(locals.panelists); return locals; } +function getEpisodeLocals() { + var episodeRelative = '../episodes'; + var episodeDirectories = getDirectories(here(episodeRelative)); + var episodes = []; + var pastEpisodes = []; + + _.each(episodeDirectories, function(date) { + var episodeData = getDataFromHson(here(episodeRelative + '/' + date + '/data.hson')); + if (!_.isEmpty(episodeData)) { + episodeData = modifyEpisodeData(episodeData, date); + if (isPast(episodeData.dateTime)) { + pastEpisodes.push(episodeData); + } else { + episodes.push(episodeData); + } + } + }); + + return { + episodes: episodes, + pastEpisodes: pastEpisodes + }; + + + function modifyEpisodeData(episode, date) { + episode.dateTime = _.isUndefined(episode.dateTime) ? date + ' 11:00' : episode.dateTime; + if (episode.dateTime) { + episode.dateTime = moment.tz(episode.dateTime, episode.timezone || 'America/Los_Angeles'); + if (!episode.displayDate) { + episode.displayDate = episode.dateTime.format('dddd, MMM Do, YYYY [at] h:mm A [(]z[)]'); + } + } else { + episode.displayDate = '(Date and Time TBA)'; + } + + episode.guests = smartChunk(episode.guests); + + return episode; + } +} + +function getDirectories(srcpath) { + return fs.readdirSync(srcpath).filter(function(file) { + return fs.statSync(path.join(srcpath, file)).isDirectory(); + }); +} + +function getDataFromHson(path) { + var absolutePath = here(path); + var exists = fs.existsSync(absolutePath); + if (exists) { + var hsonString = fs.readFileSync(absolutePath, 'utf-8'); + if (hsonString) { + return hson.parse(hsonString); + } + } + return {}; +} + + +function isFuture(date) { + return moment().diff(date) < 0; +} + +function isPast(date) { + return !isFuture(date); +} + +function smartChunk(array) { + if (_.isEmpty(array)) { + return []; + } + var chunk = 4; + if (array.length === 5 || array.length === 6) { + chunk = 3; + } + return _.chunk(array, chunk); +} + function here(dest) { return path.resolve(__dirname, dest); } diff --git a/styles.css b/styles.css index 21bdc9c..4d40e2d 100644 --- a/styles.css +++ b/styles.css @@ -1,8 +1,8 @@ /*now that styles are loading, switch these*/ -.\+hide-without-styles.\--show { +.hide-without-styles.show { display: block; } -.\+show-without-styles { +.show-without-styles { display: none; } @@ -152,6 +152,7 @@ margin-top: 40px; max-width: 400px; margin-bottom: 40px; + text-align: center; } .group-4 { @@ -321,3 +322,40 @@ h2 { .no-decorate:hover { text-decoration: none; } + +/*Flex stuff*/ + +.display-flex { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; +} + +.flex-1 { + -webkit-box-flex: 1; + -webkit-flex: 1; + -ms-flex: 1; + flex: 1; +} + +.flex-2 { + -webkit-box-flex: 2; + -webkit-flex: 2; + -ms-flex: 2; + flex: 2; +} + +.flex-3 { + -webkit-box-flex: 3; + -webkit-flex: 3; + -ms-flex: 3; + flex: 3; +} + +.flex-4 { + -webkit-box-flex: 4; + -webkit-flex: 4; + -ms-flex: 4; + flex: 4; +}