-
Notifications
You must be signed in to change notification settings - Fork 732
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/gulping' into develop
- Loading branch information
Showing
7 changed files
with
50 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,48 @@ | ||
var gulp = require('gulp'), | ||
sass = require('gulp-sass'), | ||
prefix = require('gulp-autoprefixer'), | ||
livereload = require('gulp-livereload'); | ||
var browserSync = require('browser-sync').create(), | ||
gulp = require('gulp'), | ||
prefix = require('gulp-autoprefixer'), | ||
sass = require('gulp-sass'), | ||
sourcemaps = require('gulp-sourcemaps'); | ||
|
||
var HTML = 'zinnia/templates/**/*.html', | ||
THEME = 'zinnia/static/zinnia/theme/sass/**/*.scss', | ||
DASHBOARD = 'zinnia/static/zinnia/admin/dashboard/sass/*.scss'; | ||
|
||
gulp.task('theme', function() { | ||
browserSync.notify('Compiling theme, please wait !'); | ||
|
||
return gulp.src('zinnia/static/zinnia/theme/sass/**/*.scss') | ||
.pipe(sass({errLogToConsole: true})) | ||
return gulp.src(THEME) | ||
.pipe(sourcemaps.init()) | ||
.pipe(sass().on('error', sass.logError)) | ||
.pipe(prefix()) | ||
.pipe(gulp.dest('zinnia/static/zinnia/theme/css')); | ||
.pipe(sourcemaps.write()) | ||
.pipe(gulp.dest('zinnia/static/zinnia/theme/css')) | ||
.pipe(browserSync.stream()); | ||
}); | ||
|
||
gulp.task('admin-dashboard', function() { | ||
gulp.task('dashboard', function() { | ||
browserSync.notify('Compiling dashboard, please wait !'); | ||
|
||
return gulp.src('zinnia/static/zinnia/admin/dashboard/sass/*.scss') | ||
.pipe(sass({errLogToConsole: true})) | ||
return gulp.src(DASHBOARD) | ||
.pipe(sourcemaps.init()) | ||
.pipe(sass().on('error', sass.logError)) | ||
.pipe(prefix()) | ||
.pipe(gulp.dest('zinnia/static/zinnia/admin/dashboard/css')); | ||
.pipe(sourcemaps.write()) | ||
.pipe(gulp.dest('zinnia/static/zinnia/admin/dashboard/css')) | ||
.pipe(browserSync.stream()); | ||
}); | ||
|
||
gulp.task('watch', function() { | ||
gulp.task('serve', function() { | ||
|
||
livereload.listen(); | ||
browserSync.init({ | ||
proxy: 'localhost:8000', | ||
serveStatic: ['zinnia/static'] | ||
}); | ||
|
||
gulp.watch(['zinnia/static/zinnia/**/*', | ||
'zinnia/templates/**/*']).on('change', livereload.changed); | ||
|
||
gulp.watch('zinnia/static/zinnia/theme/sass/**/*.scss', ['theme']); | ||
gulp.watch('zinnia/static/zinnia/admin/dashboard/sass/*.scss', ['admin-dashboard']); | ||
gulp.watch(HTML).on('change', browserSync.reload); | ||
gulp.watch(THEME, ['theme']); | ||
gulp.watch(DASHBOARD, ['dashboard']); | ||
|
||
}); | ||
|
||
|
||
gulp.task('default', ['theme', 'admin-dashboard', 'watch']); | ||
gulp.task('default', ['serve']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
{ | ||
"name": "django-blog-zinnia", | ||
"description": "Sass builder for django-blog-zinnia", | ||
"private": true, | ||
"devDependencies": { | ||
"gulp": "*", | ||
"gulp-sass": "*", | ||
"gulp-livereload": "*", | ||
"gulp-autoprefixer": "*" | ||
"browser-sync": "^2.18.8", | ||
"gulp": "^3.9.1", | ||
"gulp-autoprefixer": "^3.1.1", | ||
"gulp-sass": "^3.1.0", | ||
"gulp-sourcemaps": "^2.4.1" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters