Skip to content

Commit

Permalink
deployment, favicon, livereload, mapzen apikey
Browse files Browse the repository at this point in the history
  • Loading branch information
almereyda committed Oct 4, 2015
1 parent 8771e64 commit 10ce7e7
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
lib/tangram.min.js
node_modules/
_public
npm-debug.log
2 changes: 1 addition & 1 deletion deploy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ `git rev-list HEAD...$upstream/master --count` -ne 0 ]; then
echo "not deploying"
exit 1
fi
npm i
npm start --version && [ -d "./node_modules/tangram" ] || npm i
rm -rf _public

# use --reference when not in shallow clone
Expand Down
53 changes: 41 additions & 12 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,61 @@
var gulp = require('gulp');
var bs = require('browser-sync').create();

build_path = '_public';
var reload = bs.reload;
var build_path = '_public';

gulp.task('index', function() {
return gulp.src([
'index.html',
'main.js',
'scene.yaml'])
.pipe(gulp.dest(build_path));
});

gulp.task('env', function() {
return gulp.src([
gulp.src([
'.env',
'.static'])
.pipe(gulp.dest(build_path));
});


gulp.task('index', function() {
gulp.src('index.html')
.pipe(gulp.dest(build_path));
});

gulp.task('favicons', function() {
gulp.src('res/favicon.ico')
.pipe(gulp.dest(build_path));
});

gulp.task('libs', function() {
return gulp.src('lib/**')
gulp.src('lib/**')
.pipe(gulp.dest(build_path + '/lib'));
});


gulp.task('tangram', function() {
return gulp.src('node_modules/tangram/dist/tangram.min.js')
gulp.src('node_modules/tangram/dist/tangram.min.js')
.pipe(gulp.dest(build_path + '/lib'));
});

gulp.task('build', ['index', 'env', 'libs', 'tangram']);
gulp.task('setting', function() {
gulp.src([
'main.js',
'scene.yaml'])
.pipe(gulp.dest(build_path));
});


gulp.task('server', function() {
bs.init({
server: {
baseDir: build_path,
}
});
gulp.watch(['main.js','scene.yaml'], ['setting']);
gulp.watch(['index.html'], ['index']);

gulp.watch(['index.html'], {cwd: build_path}, reload);
gulp.watch(['main.js','scene.yaml'], {cwd: build_path}, reload);
});


gulp.task('build', ['env', 'index', 'favicons', 'libs', 'tangram', 'setting']);
gulp.task('dev', ['build', 'server']);
gulp.task('default', ['build']);
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<title>alternatives berlin</title>

<link rel="stylesheet" href="lib/leaflet/leaflet.css" />
<link rel="icon" href="/favicon.ico" type="image/x-icon" />

<style>
body {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
"description": "Eine interaktive 3D Karte zur Darstellung der dynamiken des alternativen Berlins.",
"main": "main.js",
"dependencies": {
"gulp": "^3.9.0",
"tangram": "tangrams/tangram"
},
"devDependencies": {
"gulp": "^3.9.0"
"browser-sync": "^2.9.8"
},
"scripts": {
"start": "node_modules/gulp/bin/gulp.js",
"serve": "node_modules/gulp/bin/gulp.js server",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down
Binary file added res/favicon.ico
Binary file not shown.
4 changes: 2 additions & 2 deletions scene.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ styles:
sources:
osm:
type: TopoJSONTiles
url: //vector.mapzen.com/osm/all/{z}/{x}/{y}.topojson
url: //vector.mapzen.com/osm/all/{z}/{x}/{y}.topojson?api_key=vector-tiles-VLxfzaw
layers:
water:
data: { source: osm }
Expand Down Expand Up @@ -73,4 +73,4 @@ layers:
text:
font:
fill: white
typeface: 100 11px Helvetica
typeface: 100 11px Helvetica

0 comments on commit 10ce7e7

Please sign in to comment.