Permalink
Browse files

Merge pull request #41 from ericclemmons/33-docs

New Website + Documentation

Closes #33
  • Loading branch information...
2 parents 6868099 + 50981df commit 4215eb1e3e3e73f764f0240acf16b9462edcc063 @ericclemmons committed Jan 22, 2013
Showing with 437 additions and 289 deletions.
  1. +1 −1 .gitignore
  2. +1 −1 Procfile
  3. +1 −2 component.json
  4. +47 −46 grunt.js
  5. +3 −2 package.json
  6. BIN src/client/{ → app}/img/background.jpg
  7. BIN src/client/{ → app}/img/overlay-dot.png
  8. +22 −0 src/client/app/js/app.js
  9. +10 −0 src/client/app/js/controllers/errorController.js
  10. +7 −0 src/client/app/js/controllers/homeController.js
  11. +10 −0 src/client/app/js/controllers/index.js
  12. +6 −0 src/client/app/js/directives/index.js
  13. +16 −0 src/client/app/js/directives/issuesDirective.js
  14. +14 −0 src/client/app/js/services/apiService.js
  15. +23 −0 src/client/app/js/services/githubService.js
  16. +6 −0 src/client/app/js/services/index.js
  17. +42 −55 src/client/{ → app}/less/app.less
  18. +13 −0 src/client/app/views/header.html
  19. +19 −0 src/client/app/views/home.html
  20. +9 −0 src/client/app/views/home/about.html
  21. +32 −0 src/client/app/views/home/faq.html
  22. +51 −0 src/client/app/views/home/features.html
  23. +6 −0 src/client/{views → app/views/home}/get-started.html
  24. +42 −36 src/client/{views → app/views/home}/technology.html
  25. +22 −0 src/client/app/views/nav.html
  26. +7 −0 src/client/app/views/not-found.html
  27. +0 −12 src/client/js/app.js
  28. +0 −7 src/client/js/controllers/HomeController.js
  29. +0 −10 src/client/views/about.html
  30. +0 −11 src/client/views/home.html
  31. 0 { → src}/public/crossdomain.xml
  32. 0 { → src}/public/humans.txt
  33. +23 −37 src/{server/views/layout.twig → public/index.html}
  34. +4 −7 src/server/app.js
  35. +0 −10 src/server/lib/docs/index.js
  36. +0 −7 src/server/lib/docs/views/first.twig
  37. +0 −13 src/server/lib/docs/views/index.twig
  38. +0 −7 src/server/lib/docs/views/layout.twig
  39. +0 −7 src/server/lib/docs/views/second.twig
  40. +0 −18 src/server/views/index.twig
View
@@ -1,5 +1,5 @@
.DS_STORE
-build
components
+dist
node_modules
npm-debug.log
View
@@ -1 +1 @@
-web: node src/server/server
+web: npm start
View
@@ -5,7 +5,6 @@
"modernizr": "~2.6.2",
"bootstrap": "~2.2.2",
"respond": "~1.2.0",
- "github-fork-ribbon-css": "git://github.com/simonwhitaker/github-fork-ribbon-css.git",
- "angular-1.0.3": "http://code.angularjs.org/1.0.3/angular-1.0.3.zip"
+ "angular-strap": "~0.6.2"
}
}
View
@@ -9,10 +9,10 @@ module.exports = function(grunt) {
// Constants
dirs: {
client : __dirname + '/src/client/',
- lib : __dirname + '/components/',
+ components: __dirname + '/components/',
server : __dirname + '/src/server/',
- web : __dirname + '/public/',
- build : __dirname + '/public/build/'
+ public : __dirname + '/src/public/',
+ dist : __dirname + '/dist/'
},
files: {
@@ -32,12 +32,14 @@ module.exports = function(grunt) {
'* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
},
- clean: ['<%= dirs.build %>'],
+ clean: ['<%= dirs.dist %>'],
watch: {
all: {
- files : ['<%= dirs.server + files.all %>'
- ,'<%= dirs.client + files.all %>'],
- tasks : ['default', 'express-server', 'reload'],
+ files : ['grunt.js'
+ ,'<%= dirs.public + files.all %>'
+ ,'<%= dirs.server + files.all %>'
+ ,'<%= dirs.client %>/app/<%= files.all %>'],
+ tasks : ['lint', 'compile', 'concat:app', 'copy:public', 'copy:app', 'express-server', 'reload'],
options : { interrupt: true }
}
},
@@ -46,7 +48,7 @@ module.exports = function(grunt) {
lint: {
files : ['grunt.js'
,'<%= dirs.server + files.js %>'
- ,'<%= dirs.client + files.js %>']
+ ,'<%= dirs.client %>/app/<%= files.js %>']
},
jshint: {
options: {
@@ -58,9 +60,8 @@ module.exports = function(grunt) {
// Compilation
less: {
app: {
- src : ['<%= dirs.lib %>/github-fork-ribbon-css/gh-fork-ribbon.css'
- ,'<%= dirs.client %>/less/app.less'],
- dest : '<%= dirs.build %>/css/app.css'
+ src : ['<%= dirs.client %>/app/less/app.less'],
+ dest : '<%= dirs.dist %>/css/app.css'
}
},
requirejs: {
@@ -77,43 +78,44 @@ module.exports = function(grunt) {
copy: {
app: {
options : {
- cwd : '<%= dirs.client %>'
+ cwd : '<%= dirs.client %>/app'
},
- files : { '<%= dirs.build %>img/': '<%= dirs.client + files.img %>' }
+ files : { '<%= dirs.dist %>/img/': '<%= dirs.client %>/app/<%= files.img %>' }
},
- lib: {
+ bootstrap : {
options : {
- cwd : '<%= dirs.client %>'
+ cwd : '<%= dirs.components %>'
},
- files : { '<%= dirs.build %>img/': '<%= dirs.lib %>/bootstrap/<%= files.img %>' }
+ files : { '<%= dirs.dist %>/img/': '<%= dirs.components %>/bootstrap/<%= files.img %>' }
+ },
+ components: {
+ options : {
+ cwd : '<%= dirs.components %>',
+ },
+ files : { '<%= dirs.dist %>/components/': '<%= dirs.components + files.all %>' }
+ },
+ public: {
+ options : {
+ cwd : '<%= dirs.public %>'
+ },
+ files : { '<%= dirs.dist %>/' : '<%= dirs.public + files.all %>' }
}
},
ngtemplates:{
app: {
options : {
- base : '<%= dirs.client %>'
+ base : '<%= dirs.client %>/app'
},
- src : ['<%= dirs.client + files.html %>'],
- dest : '<%= dirs.build %>/js/templates.js'
+ src : ['<%= dirs.client %>/app/<%= files.html %>'],
+ dest : '<%= dirs.dist %>/js/app.templates.js'
}
},
concat: {
- angular: {
- src : ['<%= dirs.lib %>/angular-1.0.3/angular.js'
- ,'<%= dirs.lib %>/angular-1.0.3/angular-resource.js'],
- dest : '<%= dirs.build %>/js/lib/angular.js'
- },
app: {
src : ['<banner:meta.banner>'
- ,'<%= dirs.client + files.js %>'
+ ,'<%= dirs.client %>/app/<%= files.js %>'
,'<%= ngtemplates.app.dest %>'],
- dest : '<%= dirs.build %>/js/app.js'
- },
- all: {
- src : ['<banner:meta.banner>'
- ,'<%= concat.angular.dest %>'
- ,'<%= concat.app.dest %>'],
- dest : '<%= dirs.build %>/js/all.js'
+ dest : '<%= dirs.dist %>/js/app.js'
}
},
@@ -126,23 +128,21 @@ module.exports = function(grunt) {
},
smushit: {
all: {
- src : '<%= dirs.build %>/img'
+ src : '<%= dirs.dist %>/img'
}
},
min: {
- angular: {
- src : '<%= concat.angular.dest %>',
- dest : '<%= concat.angular.dest.replace(".js", ".min.js") %>'
- },
app: {
src : ['<banner:meta.banner>', '<%= concat.app.dest %>'],
dest : '<%= concat.app.dest.replace(".js", ".min.js") %>'
- },
- all: {
- src : ['<banner:meta.banner>', '<%= concat.all.dest %>'],
- dest : '<%= concat.all.dest.replace(".js", ".min.js") %>'
}
},
+ useminPrepare: {
+ html : '<%= dirs.dist %>/index.html'
+ },
+ usemin: {
+ html : '<%= dirs.dist %>/index.html'
+ },
// Live-Reload Reverse-Proxy Server
open: {
@@ -178,6 +178,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-reload');
grunt.loadNpmTasks('grunt-smushit');
+ grunt.loadNpmTasks('grunt-usemin');
/**
* Custom tasks
@@ -189,10 +190,10 @@ module.exports = function(grunt) {
* Tasks
*/
- grunt.registerTask('default', ['lint', 'compile', 'concat', 'copy']);
- grunt.registerTask('compile', ['less', 'requirejs', 'ngtemplates']);
- grunt.registerTask('build', ['clean', 'default', 'minify']);
- grunt.registerTask('minify', ['cssmin', 'min', 'smushit']);
- grunt.registerTask('server', ['default', 'express-server', 'reload', 'open', 'watch']);
+ grunt.registerTask('default', ['lint', 'compile', 'concat', 'copy']);
+ grunt.registerTask('compile', ['less', 'ngtemplates']);
+ grunt.registerTask('build', ['clean', 'default', 'minify']);
+ grunt.registerTask('minify', ['useminPrepare', 'concat', 'min', 'cssmin', 'requirejs', 'usemin', 'smushit']);
+ grunt.registerTask('server', ['default', 'express-server', 'reload', 'watch']);
};
View
@@ -20,8 +20,8 @@
"npm": "1.1.x"
},
"scripts": {
- "start": "node src/server/server",
- "install": "bower install && ./node_modules/.bin/grunt build",
+ "start": "./node_modules/.bin/grunt build && node src/server/server",
+ "install": "bower install",
"test": "./node_modules/.bin/grunt build"
},
"dependencies": {
@@ -37,6 +37,7 @@
"grunt-open": "0.1.0",
"grunt-reload": "0.2.0",
"grunt-smushit": "0.3.8",
+ "grunt-usemin": "~0.1.2",
"twig": "~0.5.3"
}
}
File renamed without changes
View
@@ -0,0 +1,22 @@
+angular
+ .module('app', [
+ 'app.controllers',
+ 'app.directives',
+ 'app.templates'
+ ])
+ .config(['$locationProvider', '$routeProvider', function($location, $router) {
+ $router
+ .when('/', {
+ redirectTo: '/home'
+ })
+ .when('/home', {
+ controller: 'app.controllers.home',
+ templateUrl: 'views/home.html'
+ })
+ .otherwise({
+ controller: 'app.controllers.error',
+ templateUrl: 'views/not-found.html'
+ })
+ ;
+ }])
+;
@@ -0,0 +1,10 @@
+angular
+ .module('app.controllers.error', [])
+ .controller('app.controllers.error', [
+ '$scope',
+ '$location',
+ function($scope, $location) {
+ $scope.location = $location;
+ }
+ ])
+;
@@ -0,0 +1,7 @@
+angular.module('app.controllers.home', [])
+ .controller('app.controllers.home', [
+ '$scope',
+ function($scope) {
+ }
+ ])
+;
@@ -0,0 +1,10 @@
+angular
+ .module('app.controllers', [
+ 'app.controllers.home',
+ 'app.controllers.error',
+ 'app.services.api'
+ ])
+ .run(['$rootScope', 'app.services.api', function($root, api) {
+ $root.package = api.get({ entity: 'package' });
+ }])
+;
@@ -0,0 +1,6 @@
+angular
+ .module('app.directives', [
+ '$strap.directives',
+ 'app.directives.issues'
+ ])
+;
@@ -0,0 +1,16 @@
+angular
+ .module('app.directives.issues', [
+ 'app.services.github'
+ ])
+ .directive('appIssues', ['app.services.github', function(github) {
+ return {
+ replace: false,
+ restrict: 'A',
+ template: '<span ng-transclude />&nbsp;<span class="badge" ng-bind="issues.data.length" />',
+ transclude: true,
+ link: function($scope, $element, attrs, controller) {
+ $scope.issues = github.query({ section: 'issues'});
+ }
+ };
+ }])
+;
@@ -0,0 +1,14 @@
+angular
+ .module('app.services.api', [
+ 'ngResource'
+ ])
+ .factory('app.services.api', [
+ '$location',
+ '$resource',
+ function($location, $resource) {
+ var api = $resource('/api/:entity');
+
+ return api;
+ }
+ ])
+;
@@ -0,0 +1,23 @@
+angular
+ .module('app.services.github', [
+ 'ngResource'
+ ])
+ .factory('app.services.github', ['$resource', function($resource) {
+
+ var api = $resource('https://api.github.com/repos/:owner/:repo/:section', {
+ owner: 'ericclemmons',
+ repo: 'genesis-skeleton'
+ }, {
+ query: {
+ method: 'JSONP',
+ params: {
+ callback: 'JSON_CALLBACK',
+ state: 'open'
+ },
+ isArray: false
+ }
+ });
+
+ return api;
+ }])
+;
@@ -0,0 +1,6 @@
+angular
+ .module('app.services', [
+ 'app.services.api',
+ 'app.services.githubApi'
+ ])
+;
Oops, something went wrong.

0 comments on commit 4215eb1

Please sign in to comment.