Skip to content

Commit

Permalink
added gulp workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Netzberufler committed Aug 22, 2016
1 parent 374034c commit e7c2143
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
@@ -0,0 +1,4 @@
package.json export-ignore
gulpfile.js export-ignore
.gitignore export-ignore
.gitattributes export-ignore
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
node_modules/
51 changes: 51 additions & 0 deletions gulpfile.js
@@ -0,0 +1,51 @@
// Include gulp
var gulp = require('gulp');

// Include Our Plugins
var rename = require( 'gulp-rename' );
var uglify = require( 'gulp-uglify' );
var rtlcss = require( 'gulp-rtlcss' );
var autoprefixer = require( 'autoprefixer' );
var postcss = require( 'gulp-postcss' );
var sorting = require( 'postcss-sorting' );
var wprtl = require( 'postcss-wprtl' );

// Minify JS
gulp.task( 'minifyjs', function() {
return gulp.src( ['js/navigation.js'] )
.pipe( uglify() )
.pipe( rename( {
suffix: '.min'
} ) )
.pipe( gulp.dest('js') );
});

// Clean up CSS
gulp.task( 'cleancss', function() {
return gulp.src( ['style.css', 'css/*.css'], { base: './' } )
.pipe( postcss( [ autoprefixer() ] ) )
.pipe( postcss( [ sorting( { 'preserve-empty-lines-between-children-rules': true } ) ] ) )
.pipe( gulp.dest( './' ) );
});

// WP RTL
gulp.task( 'wprtl', function () {
return gulp.src( 'style.css' )
.pipe( postcss( [ wprtl() ] ) )
.pipe( postcss( [ sorting( { 'preserve-empty-lines-between-children-rules': true } ) ] ) )
.pipe( rename( 'rtl.css' ) )
.pipe( gulp.dest( './' ) );
});

// Flex RTL
gulp.task( 'flexrtl', function () {
return gulp.src( 'css/flexslider.css' )
.pipe( rtlcss() )
.pipe( rename( {
suffix: '-rtl'
} ) )
.pipe( gulp.dest( 'css' ) );
});

// Default Task
gulp.task( 'default', ['minifyjs', 'cleancss'] );
29 changes: 29 additions & 0 deletions package.json
@@ -0,0 +1,29 @@
{
"name": "tortuga",
"version": "1.0.0",
"description": "WordPress Theme",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ThemeZee/tortuga.git"
},
"author": "Thomas Weichselbaumer <contact@themezee.com> (https://themezee.com)",
"license": "GPL-2.0",
"bugs": {
"url": "https://github.com/ThemeZee/tortuga/issues"
},
"homepage": "https://github.com/ThemeZee/tortuga#readme",
"devDependencies": {
"autoprefixer": "^6.4.0",
"gulp": "^3.9.1",
"gulp-postcss": "^6.1.1",
"gulp-rename": "^1.2.2",
"gulp-rtlcss": "^1.0.0",
"gulp-uglify": "^2.0.0",
"postcss-sorting": "^1.6.1",
"postcss-wprtl": "^1.2.0"
}
}

0 comments on commit e7c2143

Please sign in to comment.