Mercurial > piecrust2
annotate gulpfile.js @ 661:2f780b191541
internal: Fix a bug with registering taxonomy terms that are not strings.
Some objects, like the blog data provider's taxnonomy entries, can render as
strings, but are objects themselves. When registering them as "used terms", we
need to use their string representation.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Tue, 01 Mar 2016 22:26:09 -0800 |
parents | c1a94e1beb9d |
children | 4d0f80b2ba7f |
rev | line source |
---|---|
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
1 'use strict'; |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
2 |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
3 var gulp = require('gulp'), |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
4 util = require('gulp-util'), |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
5 sass = require('gulp-sass'), |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
6 sourcemaps = require('gulp-sourcemaps'), |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
7 rename = require('gulp-rename'), |
646
87267392a5c1
cm: Update node module versions.
Ludovic Chabant <ludovic@chabant.com>
parents:
616
diff
changeset
|
8 cssnano = require('gulp-cssnano'), |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
9 concat = require('gulp-concat'), |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
10 uglify = require('gulp-uglify'); |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
11 |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
12 // Stylesheets |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
13 gulp.task('sass', function() { |
616
ccd328d0881f
cm: Merge the 2 foodtruck folders, cleanup.
Ludovic Chabant <ludovic@chabant.com>
parents:
605
diff
changeset
|
14 return gulp.src('foodtruck/assets/sass/**/*.scss') |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
15 //.pipe(sourcemaps.init()) |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
16 .pipe(sass({ |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
17 errLogToConsole: true, |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
18 outputStyle: 'compressed', |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
19 includePaths: [ |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
20 'bower_components/bootstrap-sass/assets/stylesheets', |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
21 'bower_components/Ionicons/scss']})) |
646
87267392a5c1
cm: Update node module versions.
Ludovic Chabant <ludovic@chabant.com>
parents:
616
diff
changeset
|
22 .pipe(cssnano()) |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
23 //.pipe(sourcemaps.write()) |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
24 .pipe(rename({suffix: '.min'})) |
605 | 25 .pipe(gulp.dest('foodtruck/static/css')); |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
26 }); |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
27 gulp.task('sass:watch', function() { |
616
ccd328d0881f
cm: Merge the 2 foodtruck folders, cleanup.
Ludovic Chabant <ludovic@chabant.com>
parents:
605
diff
changeset
|
28 return gulp.watch('foodtruck/assets/sass/**/*.scss', ['sass']); |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
29 }); |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
30 |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
31 // Javascript |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
32 gulp.task('js', function() { |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
33 return gulp.src([ |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
34 'bower_components/jquery/dist/jquery.js', |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
35 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/alert.js', |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
36 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/button.js', |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
37 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/collapse.js', |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
38 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/dropdown.js', |
605 | 39 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/modal.js', |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
40 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/tooltip.js', |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
41 'bower_components/bootstrap-sass/assets/javascripts/bootstrap/transition.js', |
657
c1a94e1beb9d
admin: Show a more classic blog post listing in FoodTruck.
Ludovic Chabant <ludovic@chabant.com>
parents:
646
diff
changeset
|
42 'bower_components/jquery-timeago/jquery.timeago.js', |
616
ccd328d0881f
cm: Merge the 2 foodtruck folders, cleanup.
Ludovic Chabant <ludovic@chabant.com>
parents:
605
diff
changeset
|
43 'foodtruck/assets/js/**/*.js' |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
44 ]) |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
45 .pipe(sourcemaps.init()) |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
46 .pipe(concat('foodtruck.js')) |
646
87267392a5c1
cm: Update node module versions.
Ludovic Chabant <ludovic@chabant.com>
parents:
616
diff
changeset
|
47 //.pipe(uglify()) |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
48 .pipe(sourcemaps.write()) |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
49 .pipe(rename({suffix: '.min'})) |
605 | 50 .pipe(gulp.dest('foodtruck/static/js')); |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
51 }); |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
52 gulp.task('js:watch', function() { |
616
ccd328d0881f
cm: Merge the 2 foodtruck folders, cleanup.
Ludovic Chabant <ludovic@chabant.com>
parents:
605
diff
changeset
|
53 return gulp.watch('foodtruck/assets/js/**/*.js', ['js']); |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
54 }); |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
55 |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
56 // Fonts/images |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
57 gulp.task('fonts', function() { |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
58 return gulp.src([ |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
59 'bower_components/bootstrap-sass/assets/fonts/bootstrap/*', |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
60 'bower_components/Ionicons/fonts/*' |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
61 ]) |
605 | 62 .pipe(gulp.dest('foodtruck/static/fonts')); |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
63 }); |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
64 |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
65 gulp.task('images', function() { |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
66 return gulp.src([ |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
67 'bower_components/bootstrap-sass/assets/images/*', |
616
ccd328d0881f
cm: Merge the 2 foodtruck folders, cleanup.
Ludovic Chabant <ludovic@chabant.com>
parents:
605
diff
changeset
|
68 'foodtruck/assets/img/*' |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
69 ]) |
605 | 70 .pipe(gulp.dest('foodtruck/static/img')); |
603
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
71 }); |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
72 |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
73 // Launch tasks |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
74 gulp.task('default', function() { |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
75 gulp.start(['sass', 'js', 'fonts', 'images']); |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
76 }); |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
77 |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
78 gulp.task('watch', function() { |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
79 gulp.start(['sass:watch', 'js:watch']); |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
80 }); |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
81 |
7e4e567377cd
cm: Put Bower/Gulp/etc. stuff all at the root.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
82 |