-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"directory": "bower_components" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.DS_Store | ||
bower_components | ||
node_modules | ||
npm-debug.log | ||
css |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Changelog | ||
|
||
## Version 1.0 (Jan 19, 2016) | ||
|
||
Initial release. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Nodejs + Foundation template | ||
|
||
This is a template to start your own Nodejs+Foundation project that uses Grunt and libsass! | ||
|
||
## Requirements | ||
|
||
You'll need to have the following items installed before continuing. | ||
|
||
* [Node.js](http://nodejs.org): Use the installer provided on the NodeJS website. | ||
* [Grunt](http://gruntjs.com/): Run `[sudo] npm install -g grunt-cli` | ||
* [Bower](http://bower.io): Run `[sudo] npm install -g bower` | ||
|
||
## Quickstart | ||
|
||
```bash | ||
git clone [email protected]:ThePFMind/nodejs-foundation-template.git | ||
npm install && bower install | ||
``` | ||
|
||
While you're working on your project, run: | ||
|
||
`grunt` | ||
|
||
And you're set! | ||
|
||
## Directory Structure | ||
|
||
* `scss/_settings.scss`: Foundation configuration settings go in here | ||
* `scss/app.scss`: Application styles go here |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
'use strict'; | ||
|
||
const Hapi = require('hapi'); | ||
const Hoek = require('hoek'); | ||
|
||
const server = new Hapi.Server(); | ||
|
||
server.connection({host: 'localhost', port: 3000}); | ||
|
||
server.register([ | ||
require('inert') | ||
], (err) => { | ||
if (err) throw err; | ||
server.route([ | ||
{ | ||
method: 'GET', | ||
path: '/assets/{path*}', | ||
handler: { | ||
directory: { | ||
path: 'public', | ||
listing: false | ||
} | ||
} | ||
}, | ||
{ | ||
method: 'GET', | ||
path: '/', | ||
handler: (response, reply) => { | ||
reply.view('home'); | ||
} | ||
} | ||
]) | ||
}); | ||
|
||
server.register([ | ||
require('vision') | ||
], (err) => { | ||
Hoek.assert(!err, err); | ||
|
||
server.views({ | ||
engines: { | ||
hbs: require('handlebars') | ||
}, | ||
relativeTo: __dirname, | ||
path: './views', | ||
layout: true, | ||
layoutPath: './views/layouts' | ||
//partialsPath: './views/partials' | ||
}) | ||
}); | ||
|
||
server.start((err) => { | ||
Hoek.assert(!err, err); | ||
console.log('Server running at ', server.info.uri); | ||
}); | ||
|
||
module.exports = server; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "nodejs-foundation-template", | ||
"version": "1.0.0", | ||
"authors": [ | ||
"ThePFMind <[email protected]>" | ||
], | ||
"description": "Basic template for a new Nodejs + Foundation for Sites project.", | ||
"license": "MIT", | ||
"dependencies": { | ||
"foundation-sites": "~6.1.0", | ||
"motion-ui": "~1.1.0" | ||
}, | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
"private": true | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
var gulp = require('gulp'); | ||
var $ = require('gulp-load-plugins')(); | ||
var rimraf = require('rimraf'); | ||
var sequence = require('run-sequence'); | ||
|
||
// File paths to various assets are defined here. | ||
var PATHS = { | ||
sass: [ | ||
'bower_components/foundation-sites/scss', | ||
'bower_components/motion-ui/src' | ||
], | ||
javascript: [ | ||
'bower_components/foundation-sites/dist/foundation.js', | ||
'bower_components/jquery/dist/jquery.js', | ||
'bower_components/what-input/what-input.js' | ||
] | ||
}; | ||
|
||
// Delete the "dist" folder | ||
// This happens every time a build starts | ||
gulp.task('clean', function (done) { | ||
rimraf('public/js/libs', done); | ||
}); | ||
|
||
// Compile Sass into CSS | ||
gulp.task('sass', function () { | ||
return gulp.src('public/scss/app.scss') | ||
.pipe($.sass({ | ||
includePaths: PATHS.sass | ||
}).on('error', $.sass.logError)) | ||
|
||
.pipe($.autoprefixer({ | ||
browsers: ['last 2 versions', 'ie >= 9'] | ||
})) | ||
|
||
.pipe(gulp.dest('css')); | ||
}); | ||
|
||
// Copy files to assets folder | ||
gulp.task('copy', function () { | ||
return gulp.src(PATHS.javascript) | ||
.pipe(gulp.dest('public/js/libs')); | ||
}); | ||
|
||
// Build the "public" folder by running all of the above tasks | ||
gulp.task('build', function (done) { | ||
sequence('clean', ['sass', 'copy'], done); | ||
}); | ||
|
||
gulp.task('default', ['sass'], function () { | ||
gulp.watch(['public/scss/**/*.scss'], ['sass']); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"ext": "js json hbs" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "nodejs-foundation-template", | ||
"version": "1.0.0", | ||
"description": "Nodejs + foundation template", | ||
"main": "app.js", | ||
"dependencies": { | ||
"gulp-autoprefixer": "^3.1.0", | ||
"handlebars": "^4.0.5", | ||
"hapi": "^12.1.0", | ||
"hoek": "^3.0.4", | ||
"inert": "^3.2.0", | ||
"vision": "^4.0.1" | ||
}, | ||
"devDependencies": { | ||
"gulp": "^3.9.0", | ||
"gulp-autoprefixer": "^3.1.0", | ||
"gulp-load-plugins": "^1.1.0", | ||
"gulp-sass": "^2.1.0", | ||
"rimraf": "^2.4.3", | ||
"run-sequence": "^1.1.0" | ||
}, | ||
"scripts": { | ||
"start": "nodemon", | ||
"build": "gulp build" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "[email protected]:ThePFMind/nodejs-foundation-template.git" | ||
}, | ||
"author": "ThePFMind <[email protected]>", | ||
"license": "MIT", | ||
"private": true | ||
} |