Skip to content

Commit

Permalink
Merge pull request #41 from BlackrockDigital/dev
Browse files Browse the repository at this point in the history
Bootstrap 4.3.1, npm start script, gulpfile update
  • Loading branch information
davidtmiller authored Feb 17, 2019
2 parents a1e7bce + 25ee023 commit efd6bbd
Show file tree
Hide file tree
Showing 53 changed files with 5,427 additions and 810 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Preview

[![Resume Preview](https://startbootstrap.com/assets/img/templates/resume.jpg)](https://blackrockdigital.github.io/startbootstrap-resume/)
[![Resume Preview](https://startbootstrap.com/assets/img/screenshots/themes/resume.png)](https://blackrockdigital.github.io/startbootstrap-resume/)

**[View Live Preview](https://blackrockdigital.github.io/startbootstrap-resume/)**

Expand Down Expand Up @@ -32,12 +32,12 @@ After downloading, simply edit the HTML and CSS files included with the template

### Advanced Usage

After installation, run `npm install` and then run `gulp dev` which will open up a preview of the template in your default browser, watch for changes to core template files, and live reload the browser when changes are saved. You can view the `gulpfile.js` to see which tasks are included with the dev environment.
After installation, run `npm install` and then run `npm start` which will open up a preview of the template in your default browser, watch for changes to core template files, and live reload the browser when changes are saved. You can view the `gulpfile.js` to see which tasks are included with the dev environment.

#### Gulp Tasks

- `gulp` the default task that builds everything
- `gulp dev` browserSync opens the project in your default browser and live reloads when changes are made
- `gulp watch` browserSync opens the project in your default browser and live reloads when changes are made
- `gulp css` compiles SCSS files into CSS and minifies the compiled CSS
- `gulp js` minifies the themes JS file
- `gulp vendor` copies dependencies from node_modules to the vendor directory
Expand Down
2 changes: 1 addition & 1 deletion css/resume.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Start Bootstrap - Resume v5.0.3 (https://startbootstrap.com/template-overviews/resume)
* Start Bootstrap - Resume v5.0.4 (https://startbootstrap.com/template-overviews/resume)
* Copyright 2013-2019 Start Bootstrap
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-resume/blob/master/LICENSE)
*/
Expand Down
2 changes: 1 addition & 1 deletion css/resume.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

110 changes: 57 additions & 53 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
"use strict";

// Load plugins
const autoprefixer = require("gulp-autoprefixer");
const browsersync = require("browser-sync").create();
const cleanCSS = require("gulp-clean-css");
const del = require("del");
const gulp = require("gulp");
const header = require("gulp-header");
const merge = require("merge-stream");
const plumber = require("gulp-plumber");
const rename = require("gulp-rename");
const sass = require("gulp-sass");
const uglify = require("gulp-uglify");

// Load package.json for banner
const pkg = require('./package.json');

// Set the banner content
Expand All @@ -19,47 +25,56 @@ const banner = ['/*!\n',
'\n'
].join('');

// Copy third party libraries from /node_modules into /vendor
gulp.task('vendor', function(cb) {
// BrowserSync
function browserSync(done) {
browsersync.init({
server: {
baseDir: "./"
},
port: 3000
});
done();
}

// Bootstrap
gulp.src([
'./node_modules/bootstrap/dist/**/*',
'!./node_modules/bootstrap/dist/css/bootstrap-grid*',
'!./node_modules/bootstrap/dist/css/bootstrap-reboot*'
])
.pipe(gulp.dest('./vendor/bootstrap'))
// BrowserSync reload
function browserSyncReload(done) {
browsersync.reload();
done();
}

// Font Awesome
gulp.src([
'./node_modules/@fortawesome/**/*',
])
.pipe(gulp.dest('./vendor'))
// Clean vendor
function clean() {
return del(["./vendor/"]);
}

// Bring third party dependencies from node_modules into vendor directory
function modules() {
// Bootstrap
var bootstrap = gulp.src('./node_modules/bootstrap/dist/**/*')
.pipe(gulp.dest('./vendor/bootstrap'));
// Font Awesome
var fontAwesome = gulp.src('./node_modules/@fortawesome/**/*')
.pipe(gulp.dest('./vendor'));
// jQuery Easing
var jqueryEasing = gulp.src('./node_modules/jquery.easing/*.js')
.pipe(gulp.dest('./vendor/jquery-easing'));
// jQuery
gulp.src([
var jquery = gulp.src([
'./node_modules/jquery/dist/*',
'!./node_modules/jquery/dist/core.js'
])
.pipe(gulp.dest('./vendor/jquery'))

// jQuery Easing
gulp.src([
'./node_modules/jquery.easing/*.js'
])
.pipe(gulp.dest('./vendor/jquery-easing'))

cb();

});
.pipe(gulp.dest('./vendor/jquery'));
return merge(bootstrap, fontAwesome, jquery, jqueryEasing);
}

// CSS task
function css() {
return gulp
.src("./scss/*.scss")
.src("./scss/**/*.scss")
.pipe(plumber())
.pipe(sass({
outputStyle: "expanded"
outputStyle: "expanded",
includePaths: "./node_modules",
}))
.on("error", sass.logError)
.pipe(autoprefixer({
Expand Down Expand Up @@ -98,34 +113,23 @@ function js() {
.pipe(browsersync.stream());
}

// Tasks
gulp.task("css", css);
gulp.task("js", js);

// BrowserSync
function browserSync(done) {
browsersync.init({
server: {
baseDir: "./"
}
});
done();
}

// BrowserSync Reload
function browserSyncReload(done) {
browsersync.reload();
done();
}

// Watch files
function watchFiles() {
gulp.watch("./scss/**/*", css);
gulp.watch(["./js/**/*.js", "!./js/*.min.js"], js);
gulp.watch("./js/**/*", js);
gulp.watch("./**/*.html", browserSyncReload);
}

gulp.task("default", gulp.parallel('vendor', css, js));

// dev task
gulp.task("dev", gulp.parallel(watchFiles, browserSync));
// Define complex tasks
const vendor = gulp.series(clean, modules);
const build = gulp.series(vendor, gulp.parallel(css, js));
const watch = gulp.series(build, gulp.parallel(watchFiles, browserSync));

// Export tasks
exports.css = css;
exports.js = js;
exports.clean = clean;
exports.vendor = vendor;
exports.build = build;
exports.watch = watch;
exports.default = build;
2 changes: 1 addition & 1 deletion js/resume.min.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Start Bootstrap - Resume v5.0.3 (https://startbootstrap.com/template-overviews/resume)
* Start Bootstrap - Resume v5.0.4 (https://startbootstrap.com/template-overviews/resume)
* Copyright 2013-2019 Start Bootstrap
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-resume/blob/master/LICENSE)
*/
Expand Down
Loading

0 comments on commit efd6bbd

Please sign in to comment.