generated from zaymund/uka-theme-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d86eb40
Showing
24 changed files
with
11,157 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# ignore node dependency directories | ||
node_modules/ |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Falkorn Theme Documentation | ||
Documentation for our Falkorn WordPress Theme. |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
'use strict'; | ||
/** | ||
* Inline and compress html file. | ||
* | ||
* Compiles: | ||
* build/index.html | ||
* | ||
* @command npm build | ||
*/ | ||
var inline = require('inline-source'), | ||
fs = require('filendir'), | ||
path = require('path') , | ||
src = 'src/index.html', | ||
build = 'build/index.html'; | ||
|
||
inline(src, { | ||
compress: true, | ||
attribute: false, | ||
svgAsImage: true, | ||
rootpath: path.dirname(src), | ||
ignore: ['script'] | ||
}, function (err, html) { | ||
if (!err) { | ||
fs.writeFileSync(build, html); | ||
} else { | ||
throw err; | ||
} | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"baseDir" : "src", | ||
|
||
"stylesSrc" : "./src/sass", | ||
"stylesDest" : "./src/css", | ||
|
||
"imagesSrc" : "./src/images/src", | ||
"imagesDest" : "./src/images" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
/** | ||
* Gulpfile Home | ||
* @see gulpfile.js/tasks | ||
* | ||
* @command npm install | ||
* @command gulp watch | ||
* | ||
* @command gulp all | ||
* @command gulp styles | ||
* @command gulp images | ||
*/ | ||
const gulp = require( 'gulp' ); | ||
const requireDir = require( 'require-dir' ); | ||
const forwardRef = require( 'undertaker-forward-reference' ); | ||
|
||
gulp.registry( forwardRef() ); | ||
requireDir( './tasks', { extensions: ['.js'] } ); |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use strict'; | ||
/** | ||
* Default Task Commands | ||
* | ||
* @command gulp all | ||
* @command gulp watch | ||
*/ | ||
const gulp = require( 'gulp' ); | ||
const browserSync = require( 'browser-sync' ); | ||
const config = require( '../config.json' ); | ||
|
||
const browsersync = done => { | ||
browserSync.init({ | ||
server: { baseDir: config.baseDir + '/' }, | ||
open: false, | ||
notify: false, | ||
injectChanges: true, | ||
online: true, | ||
watchEvents: [ 'change', 'add', 'unlink', 'addDir', 'unlinkDir' ] | ||
}); | ||
done(); | ||
}; | ||
|
||
const browserReload = done => { | ||
browserSync.reload(); | ||
done(); | ||
}; | ||
|
||
|
||
/** | ||
* Run All Builder Tasks | ||
*/ | ||
gulp.task( 'all', gulp.series( 'styles', 'images' ) ); | ||
|
||
|
||
/** | ||
* Watch For File Changes & Run Tasks | ||
*/ | ||
gulp.task( 'watch', gulp.series( 'styles', 'images', browsersync, () => { | ||
gulp.watch( [config.stylesSrc + '/*.scss', config.stylesSrc + '/**/*.scss'], gulp.series( 'styles' ) ) | ||
gulp.watch( config.imagesSrc + '/*{.jpg,.gif,.png,.svg}', gulp.series( 'images' ) ) | ||
gulp.watch( config.baseDir + '/*.html', gulp.series( browserReload ) ) | ||
})); |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
'use strict'; | ||
/** | ||
* Minify Images (png, jpeg, gif, svg) | ||
* | ||
* Compiles: | ||
* images/*.(png, jpeg, gif, svg) | ||
* | ||
* @command gulp images | ||
*/ | ||
const gulp = require( 'gulp' ); | ||
const newer = require( 'gulp-newer' ); | ||
const imagemin = require( 'gulp-imagemin' ); | ||
const notify = require( 'gulp-notify' ); | ||
const config = require( '../config.json' ); | ||
|
||
|
||
/** | ||
* Minify Images | ||
*/ | ||
gulp.task( 'images', () => { | ||
return gulp | ||
.src( config.imagesSrc + '/*{.jpg,.gif,.png,.svg}' ) | ||
.pipe( newer( config.imagesDest ) ) | ||
.pipe( | ||
imagemin([ | ||
imagemin.gifsicle({ interlaced: true }), | ||
imagemin.jpegtran({ progressive: true }), | ||
imagemin.optipng({ optimizationLevel: 3 }), // 0-7 low-high | ||
imagemin.svgo({ | ||
plugins: [ { removeViewBox: true }, { cleanupIDs: false } ] | ||
}) | ||
]) | ||
) | ||
.pipe( gulp.dest( config.imagesDest ) ) | ||
.pipe( notify({ message: '\n\n✅ ===> IMAGES — completed!\n', onLast: true }) ) | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
/** | ||
* Make an index.js in a directory with this code to clean things up: | ||
* @source https://github.com/aseemk/requireDir | ||
*/ | ||
module.exports = require('require-dir')(); // defaults to '.' |
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
'use strict'; | ||
/** | ||
* Theme Styles | ||
* | ||
* Compiles: | ||
* css/style.css | ||
* | ||
* @command gulp styles | ||
*/ | ||
const gulp = require( 'gulp' ); | ||
const sass = require( 'gulp-sass' ); | ||
const browserSync = require( 'browser-sync' ); | ||
const autoprefixer = require( 'gulp-autoprefixer' ); | ||
const lineec = require( 'gulp-line-ending-corrector' ); | ||
const plumber = require( 'gulp-plumber' ); | ||
const beep = require( 'beepbeep' ); | ||
const notify = require( 'gulp-notify' ); | ||
const config = require( '../config.json' ); | ||
|
||
const autoprefixers = [ | ||
'last 2 version', | ||
'> 1%', | ||
'ie >= 11', | ||
'last 1 Android versions', | ||
'last 1 ChromeAndroid versions', | ||
'last 2 Chrome versions', | ||
'last 2 Firefox versions', | ||
'last 2 Safari versions', | ||
'last 2 iOS versions', | ||
'last 2 Edge versions', | ||
'last 2 Opera versions' | ||
]; | ||
|
||
|
||
/** | ||
* Custom Error Handler. | ||
* | ||
* @param Mixed err | ||
*/ | ||
const errorHandler = r => { | ||
notify.onError( '\n\n❌ ===> ERROR: <%= error.message %>\n' )( r ); | ||
beep(); | ||
}; | ||
|
||
|
||
/** | ||
* Create style.css | ||
*/ | ||
gulp.task( 'styles', () => { | ||
return gulp | ||
.src( config.stylesSrc + '/*.scss', { allowEmpty: true } ) | ||
.pipe( plumber( errorHandler ) ) | ||
.pipe( | ||
sass({ | ||
errLogToConsole: true, | ||
outputStyle: 'expanded', | ||
precision: 5 | ||
}) | ||
) | ||
.on( 'error', sass.logError ) | ||
.pipe( autoprefixer( autoprefixers ) ) | ||
.pipe( lineec() ) | ||
.pipe( gulp.dest( config.stylesDest ) ) | ||
.pipe( browserSync.stream() ) | ||
}); |
Oops, something went wrong.